home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / os2 / redbk4.zip / GG243774.INF (.txt)
OS/2 Help File  |  1992-09-28  |  646KB  |  19,998 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. (C) Copyright IBM Corp. 1992 ΓòÉΓòÉΓòÉ
  3.  
  4. (C) Copyright International Business Machines Corporation 1992. All rights 
  5. reserved. 
  6.  
  7. Note to U.S. Government Users - Documentation related to restricted rights - 
  8. Use, duplication or disclosure is subject to restrictions set forth in GSA ADP 
  9. Schedule Contract with IBM Corp. 
  10.  
  11.  
  12. ΓòÉΓòÉΓòÉ 2. Cover ΓòÉΓòÉΓòÉ
  13.  
  14.  
  15. ΓòÉΓòÉΓòÉ <hidden> Title Page ΓòÉΓòÉΓòÉ
  16.  
  17.  
  18.                                                                 OS/2 Version 2.0
  19.                                                            Volume 4: Application
  20.                                                                      Development
  21.  
  22.                                                     Document Number GG24-3774-00
  23.  
  24.                                                                       April 1992
  25.  
  26.  
  27.                                                          International Technical
  28.                                                                   Support Center
  29.  
  30.                                                                       Boca Raton
  31.  
  32.  
  33. ΓòÉΓòÉΓòÉ 3. Version Notice ΓòÉΓòÉΓòÉ
  34.  
  35. Take Note:  Before using this information and the product it supports, be sure 
  36.             to read the general information under Special Notices. 
  37.  
  38. First Edition (April 1992) 
  39.  
  40. This edition applies to Version 2.0 of Operating System/2. 
  41.  
  42. Order publications through your IBM representative or the IBM branch office 
  43. serving your locality. Publications are not stocked at the address given below. 
  44.  
  45. A form for reader's comments appears at the back of this publication. If the 
  46. form has been removed, address your comments to: 
  47.  
  48. IBM Corporation, International Technical Support Center
  49. Dept. 91J, Building 235-2 Internal Zip 4423
  50. 901 NW 51st Street
  51. Boca Raton, Florida 33432
  52.  
  53. When you send information to IBM, you grant IBM a non-exclusive right to use or 
  54. distribute the information in any way it believes appropriate without incurring 
  55. any obligation to you. 
  56.  
  57. MAK - Revision 1.0
  58.  
  59.  
  60. ΓòÉΓòÉΓòÉ 4. Abstract ΓòÉΓòÉΓòÉ
  61.  
  62. This document describes application development for OS/2 Version 2.0.  It forms 
  63. Volume 4 of a five volume set; the other volumes are: 
  64.  
  65.  OS/2 Version 2.0 - Volume 1:  Control Program, GG24-3730 
  66.  
  67.  OS/2 Version 2.0 - Volume 2:  DOS and Windows Environment, GG24-3731 
  68.  
  69.  OS/2 Version 2.0 - Volume 3:  Presentation Manager and Workplace Shell, 
  70.   GG24-3732 
  71.  
  72.  OS/2 Version 2.0 - Volume 5:  Print Subsystem, GG24-3775 
  73.  
  74. The entire set may be ordered as OS/2 Version 2.0 Technical Compendium, 
  75. GBOF-2254. 
  76.  
  77. This document is intended for IBM system engineers, IBM authorized dealers, IBM 
  78. customers, and others who require a knowledge of application development under 
  79. OS/2 Version 2.0. 
  80.  
  81. This document assumes that the reader is generally familiar with the function 
  82. provided in previous releases of OS/2. 
  83.  
  84. MAK - Internal Revision 1.0 
  85.  
  86.  
  87. ΓòÉΓòÉΓòÉ 5. Acknowledgements ΓòÉΓòÉΓòÉ
  88.  
  89. The advisors for this project were: 
  90.  
  91. Hans J. Goetz
  92. International Technical Support Center, Boca Raton
  93.  
  94. Giffin Lorimer
  95. International Technical Support Center, Boca Raton
  96.  
  97. The authors of this document are: 
  98.  
  99. Alan Chambers
  100. IBM United Kingdom
  101.  
  102. Franco Federico
  103. IBM United Kingdom
  104.  
  105. Neil Stokes
  106. IBM Australia
  107.  
  108. This document was compiled and published with the aid of the International 
  109. Technical Support Center, Boca Raton. 
  110.  
  111. This document was converted to the Information Presentation Facility by: 
  112.  
  113. Michael Kaply
  114. IBM Development Laboratories, Austin
  115.  
  116. Thanks to the following people for the invaluable advice and guidance provided 
  117. in the production of this document: 
  118.  
  119. Ian Ameline
  120. IBM Development Laboratories, Toronto
  121.  
  122. Mike Cowlishaw
  123. IBM United Kingdom Development Laboratories, Hursley
  124.  
  125. David Kerr
  126. IBM Programming Center, Boca Raton
  127.  
  128. Michael Kogan
  129. IBM Programming Center, Boca Raton
  130.  
  131. Peter Magid
  132. IBM Programming Center, Boca Raton
  133.  
  134. Greg Milligan
  135. IBM Canada
  136.  
  137. Larry Raper
  138. IBM Development Laboratories, Austin
  139.  
  140. Oliver Sims
  141. IBM United Kingdom
  142.  
  143. Thanks also to the many people, both within and outside IBM, who provided 
  144. suggestions and guidance, and who reviewed this document prior to publication. 
  145.  
  146. Thanks to the following people for providing excellent tools, used during 
  147. production of this document: 
  148.  
  149. Dave Hock (CUA Draw)
  150. IBM Cary.
  151.  
  152. J╨ærg von K╨önel (PM Spy)
  153. IBM Yorktown Heights.
  154.  
  155. Georg Haschek (BM2IPF)
  156. IBM Austria.
  157.  
  158.  
  159. ΓòÉΓòÉΓòÉ 6. Figures ΓòÉΓòÉΓòÉ
  160.  
  161.  Program Flow - Functional Decomposition Approach 
  162.  Program Flow - Object-Oriented Approach 
  163.  Subclassing an Application Object 
  164.  Object-Oriented Development Progression 
  165.  Encapsulation of Host Interaction Within Application Object 
  166.  Message Flow in a Presentation Manager Application 
  167.  Structure of an Application's Main Routine 
  168.  Structure of a Window Procedure 
  169.  Structure of a Dialog Procedure 
  170.  Allocating Memory in Previous Versions of OS/2 
  171.  Allocating Memory in OS/2 Version 2.0 
  172.  Committing Storage During Allocation 
  173.  Using a Guard Page With a Memory Object 
  174.  Guard Page Exception Handler 
  175.  Registering a Guard Page Exception Handler 
  176.  Suballocating Memory 
  177.  Allocating Shared Memory 
  178.  Sample Application Main Routine (Part 1) - Registration 
  179.  Sample Application Main Routine (Part 2) - Window Creation 
  180.  WinAddSwitchEntry() Function 
  181.  Storing Instance Data in Window Words 
  182.  Retrieving Instance Data from Window Words 
  183.  Releasing Instance Data Storage 
  184.  WinSubclassWindow() Function 
  185.  Subclass Window Procedure 
  186.  WinDlgBox() Function 
  187.  Communicating with a Control Window 
  188.  Querying Information From a Control Window 
  189.  Inserting an Item Into a List Box 
  190.  Querying a Selected List Box Item 
  191.  WinMessageBox() Function 
  192.  Obtaining a Window Handle - WinQueryWindow() Function 
  193.  Obtaining a Window Handle - WinWindowFromID() Function 
  194.  Obtaining a Window Handle Using the Switch Entry 
  195.  WinBroadcastMsg() Function 
  196.  Calling External Macros 
  197.  Workplace Shell Inheritance Hierarchy 
  198.  Invoking a Method 
  199.  Overriding an Existing Method 
  200.  Adding a New Method 
  201.  Adding an Item to a Context Menu 
  202.  Invoking a Method via a Context Menu Item 
  203.  Class Method Example 
  204.  Invoking a Method in Another Object Class 
  205.  A SOM Precompiler-generated Function Stub 
  206.  Registering a Workplace Shell Object Class 
  207.  Initializing Class Data 
  208.  Freeing Class Data Items 
  209.  Creating an Object 
  210.  Object Setup 
  211.  Initializing Instance Data 
  212.  Opening an Object 
  213.  Opening a Custom View of an Object 
  214.  Automatically Instantiating an Object 
  215.  Closing an Object 
  216.  Saving an Object's State 
  217.  Restoring an Object's State 
  218.  Destroying an Object 
  219.  Deregistering an Object Class 
  220.  Creating a Transient Object 
  221.  Workplace Shell Application Structure 
  222.  Referencing an Object Using OBJECTID 
  223.  Drag Initiation From a Container Window 
  224.  Receiving a DM_PRINTOBJECT Message 
  225.  Handling the DM_DRAGOVER Message 
  226.  Handling the DM_DROP Message 
  227.  Handling the DM_RENDER Message 
  228.  Menu Bar Resource Definition 
  229.  String Table Resource Definition 
  230.  Loading a Text String Resource 
  231.  Accelerator Table Resource Definition 
  232.  Window Template Resource Definition 
  233.  Dialog Template Resource Definition 
  234.  Resource Script File 
  235.  Loading Resources From a DLL 
  236.  Loading a Dialog Resource From a DLL 
  237.  Creating a Thread With an Object Window 
  238.  Secondary Thread Creating an Object Window 
  239.  Sample Object Window Procedure 
  240.  Creating a Thread Without an Object Window 
  241.  Starting a Child Process 
  242.  DosKillThread() Function 
  243.  Terminating a Process 
  244.  Interprocess Communication Using Shared Memory (Part 1) 
  245.  Interprocess Communication Using Shared Memory (Part 2) 
  246.  Interprocess Communication Using Atoms (Part 1) 
  247.  Interprocess Communication Using Atoms (Part 2) 
  248.  Interprocess Communication Using Queues (Part 1) 
  249.  Interprocess Communication Using Queues (Part 2) 
  250.  Interprocess Communication Using Queues (Part 3) 
  251.  Interprocess Communication Using Named Pipes (Part 1) 
  252.  Interprocess Communication Using Named Pipes (Part 2) 
  253.  Synchronization Using Presentation Manager Messages 
  254.  Synchronization Using an Event Semaphore (Part 1) 
  255.  Synchronization Using an Event Semaphore (Part 2) 
  256.  Synchronization Using the DosWaitThread() Function (Part 1) 
  257.  Synchronization Using the DosWaitThread() Function (Part 2) 
  258.  DosWaitChild() Function 
  259.  Dynamically Inserting a Menu Bar Item 
  260.  Dynamically Inserting a Pulldown Menu 
  261.  Disabling an Menu Bar/Pulldown Menu Item 
  262.  Placing a Check Mark on a Pulldown Menu Item 
  263.  Standard Dialogs - WinFileDlg() Function 
  264.  WinFontDlg() Function - Sample Code 
  265.  DosCreateThread() Function 
  266.  DosAllocMem() Function 
  267.  Declaring a 16-Bit Function in 32-Bit Code 
  268.  Creating a 16-bit Window From Within a 32-bit Module 
  269.  Passing a 16:16 Pointer as a Message Parameter 
  270.  Mixed Model Programming - WinSetWindowThunkProc() Function 
  271.  Mixed Model Programming - Thunk Procedure 
  272.  16:16 to 0:32 Address Conversion 
  273.  Development Process for New WPS Classes 
  274.  Compiling and Linking an OS/2 Presentation Manager Application 
  275.  Sample Module Definition File for Presentation Manager 
  276.  Sample Module Definition File to Create a DLL 
  277.  IPF Tag Language Example 
  278.  Simple Help Panel Source 
  279.  Displaying a Bitmap in a Help Window 
  280.  Hypertext Link 
  281.  Hypergraphic Link 
  282.  Link File With Multiple Hypergraphic Links 
  283.  Multiple Viewports Using Automatic Links 
  284.  Application-Controlled Viewport 
  285.  Help Table Resource Definition 
  286.  WinCreateHelpInstance() Function 
  287.  WinAssociateHelpInstance() Function 
  288.  WinDestroyHelpInstance() Function 
  289.  Help Pulldown Menu Definition 
  290.  Network Domains 
  291.  Production Libraries on a LAN Server 
  292.  
  293.  
  294. ΓòÉΓòÉΓòÉ 6.1. Program Flow - Functional Decomposition Approach ΓòÉΓòÉΓòÉ
  295.  
  296.  
  297. ΓòÉΓòÉΓòÉ 6.2. Program Flow - Object-Oriented Approach ΓòÉΓòÉΓòÉ
  298.  
  299.  
  300. ΓòÉΓòÉΓòÉ 6.3. Subclassing an Application Object ΓòÉΓòÉΓòÉ
  301.  
  302.  
  303. ΓòÉΓòÉΓòÉ 6.4. Object-Oriented Development Progression ΓòÉΓòÉΓòÉ
  304.  
  305. This diagram shows the interdependence of object-oriented design, 
  306. implementation and user interface. 
  307.  
  308.  
  309. ΓòÉΓòÉΓòÉ 6.5. Encapsulation of Host Interaction Within Application Object ΓòÉΓòÉΓòÉ
  310.  
  311.  
  312. ΓòÉΓòÉΓòÉ 6.6. Message Flow in a Presentation Manager Application ΓòÉΓòÉΓòÉ
  313.  
  314.  
  315. ΓòÉΓòÉΓòÉ 6.7. Structure of an Application's Main Routine ΓòÉΓòÉΓòÉ
  316.  
  317. int main()
  318. {
  319.     <Global data declarations>
  320.  
  321.     hAB   = WinInitialize(...);           /* Register application   */
  322.     hMsgQ = WinCreateMsgQueue(...);       /* Create message queue   */
  323.  
  324.     WinRegisterClass(...);                /* Register window class  */
  325.               :
  326.     hFrame  = WinCreateWindow(...);       /* Create frame window    */
  327.     hClient = WinCreateWindow(...);       /* Create client window   */
  328.  
  329.     WinAddSwitchEntry(...);               /* Add task manager entry */
  330.  
  331.     while (WinGetMsg(...))                /* Loop until WM_QUIT     */
  332.           WinDispatchMsg(...);
  333.  
  334.     WinRemoveSwitchEntry(...);            /* Remove task mgr entry  */
  335.  
  336.     WinDestroyWindow(hFrame);             /* Destroy main window    */
  337.     WinDestroyMsgQueue(hMsgQ);            /* Destroy message queue  */
  338.     WinTerminate(hAB);                    /* Deregister application */
  339. }
  340.  
  341.  
  342. ΓòÉΓòÉΓòÉ 6.8. Structure of a Window Procedure ΓòÉΓòÉΓòÉ
  343.  
  344. MRESULT EXPENTRY wpMain(HWND hWnd, ULONG ulMsg, MPARAM mp1, MPARAM mp2)
  345. {
  346.         switch (ulMsg)
  347.                {
  348.                case WM_CREATE:
  349.                     WinDefWindowProc(hWnd, ulMsg, mp1, mp2);
  350.                     <perform initialization of instance variables>
  351.                     <define, create or establish access to data objects>
  352.                     return((MRESULT)FALSE);
  353.                     break;
  354.                case WM_COMMAND:
  355.                     <determine command by examining message parameters>
  356.                     <perform processing for menu command>
  357.                     return((MRESULT)0);
  358.                     break;
  359.                case WM_HELP:
  360.                     <perform help processing>
  361.                     return((MRESULT)0);
  362.                     break;
  363.                       :
  364.                       :
  365.                case WM_DESTROY:
  366.                     <back out any incomplete updates>
  367.                     <close all open data objects>
  368.                     return((MRESULT)0);
  369.                     break;
  370.                default:
  371.                     return((MRESULT)WinDefWindowProc(hWnd,
  372.                                                      ulMsg,
  373.                                                      mp1,
  374.                                                      mp2));
  375.                     break;
  376.                }
  377. }
  378.  
  379.  
  380. ΓòÉΓòÉΓòÉ 6.9. Structure of a Dialog Procedure ΓòÉΓòÉΓòÉ
  381.  
  382. MRESULT EXPENTRY dpDProc(HWND hWnd, ULONG ulMsg, MPARAM mp1, MPARAM mp2)
  383. {
  384.         switch (ulMsg)
  385.                {
  386.                case WM_INITDLG:
  387.                     <extract initialization data from message parameters>
  388.                     <establish initial values for control window data>
  389.                     return((MRESULT)TRUE);
  390.                     break;
  391.                case WM_CONTROL:
  392.                     <determine originator of message and message contents>
  393.                     <perform control-specific processing>
  394.                     return((MRESULT)0);
  395.                     break;
  396.                case WM_COMMAND:
  397.                     switch LOUSHORT(mp1):
  398.                            {
  399.                            case DID_OK:
  400.                                 <complete dialog>
  401.                                 WinDismissDlg(hWnd,TRUE);
  402.                                 break;
  403.                            case DID_CANCEL:
  404.                                 <cancel dialog>
  405.                                 WinDismissDlg(hWnd,FALSE);
  406.                                 break;
  407.                            }
  408.                     return((MRESULT)0);
  409.                     break;
  410.                default:
  411.                     return((MRESULT)WinDefDlgProc(hWnd,
  412.                                                   ulMsg,
  413.                                                   mp1,
  414.                                                   mp2));
  415.                     break;
  416.                }
  417. }
  418.  
  419.  
  420. ΓòÉΓòÉΓòÉ 6.10. Allocating Memory in Previous Versions of OS/2 ΓòÉΓòÉΓòÉ
  421.  
  422. SEL    sel1, sel2;
  423. PVOID  pSegment1, pSegment2;
  424.  
  425. DosAllocSeg(0, &sel1, SEG_NONSHARED);
  426. DosAllocSeg(8192, &sel2, SEG_NONSHARED);
  427.  
  428. pSegment1=MAKEP(sel1, 0);
  429. pSegment2=MAKEP(sel2, 0);
  430.  
  431. This example shows the use of the DosAllocSeg() function to allocate multiple 
  432. segments in order to access 72KB of memory. 
  433.  
  434.  
  435. ΓòÉΓòÉΓòÉ 6.11. Allocating Memory in OS/2 Version 2.0 ΓòÉΓòÉΓòÉ
  436.  
  437. PVOID  pObject;             /* 32-bit linear pointer to memory object */
  438.  
  439. DosAllocMem(&pObject,       /* Allocate memory object                 */
  440.             73727,          /* Size of memory object                  */
  441.             PAG_READ |      /* Allow read access                      */
  442.             PAG_WRITE);     /* Allow write access                     */
  443.  
  444. This example shows the use of the DosAllocMem() function to allocate a single 
  445. 72KB memory object. 
  446.  
  447.  
  448. ΓòÉΓòÉΓòÉ 6.12. Committing Storage During Allocation ΓòÉΓòÉΓòÉ
  449.  
  450. PVOID  pObject;             /* 32-bit linear pointer to memory object */
  451.  
  452. DosAllocMem(&pObject,       /* Allocate memory object                 */
  453.             73727,          /* Size of memory object                  */
  454.             PAG_READ   |    /* Allow read access                      */
  455.             PAG_WRITE  |    /* Allow write access                     */
  456.             PAG_COMMIT);    /* Commit storage immediately             */
  457.  
  458. This example shows the use of the PAG_COMMIT flag with the DosAllocMem() 
  459. function. 
  460.  
  461.  
  462. ΓòÉΓòÉΓòÉ 6.13. Using a Guard Page With a Memory Object ΓòÉΓòÉΓòÉ
  463.  
  464. PVOID  pObject;                /* 32-bit linear pointer to memory object */
  465.  
  466. DosAllocMem(&pObject,          /* Allocate memory object                 */
  467.             73727,             /* Size of memory object                  */
  468.             PAG_READ |         /* Allow read access                      */
  469.             PAG_WRITE);        /* Allow write access                     */
  470.  
  471. DosSetMem(pObject,             /* Set memory attributes for object       */
  472.           8192L,               /* Two pages (8192 bytes)                 */
  473.           PAG_DEFAULT |        /* Default attributes from allocation     */
  474.           PAG_COMMIT);         /* Commit page                            */
  475.  
  476. DosSetMem(pObject+4096,        /* Set memory attributes for object       */
  477.           1L,                  /* Two pages (8192 bytes)                 */
  478.           PAG_DEFAULT |        /* Default attributes from allocation     */
  479.           PAG_COMMIT  |        /* Commit page                            */
  480.           PAG_GUARD);          /* Flag page as guard page                */
  481.  
  482.  
  483. ΓòÉΓòÉΓòÉ 6.14. Guard Page Exception Handler ΓòÉΓòÉΓòÉ
  484.  
  485. ULONG GPHandler(PEXCEPTIONREPORTRECORD pX)
  486. {
  487.       ULONG ulAttribs;                       /* Memory attributes        */
  488.       ULONG ulSize;                          /* Range in pages           */
  489.  
  490.       if (pX->ExceptionNum ==                /* If guard page exception  */
  491.           XCPT_GUARD_PAGE_VIOLATION)
  492.          {
  493.             ulSize=1L;                       /* One page                 */
  494.             DosQueryMem(                     /* Query memory attributes  */
  495.                (PVOID)pX->ExceptionInfo[1],  /* Page base address        */
  496.                &ulSize,                      /* Single page              */
  497.                &ulAttribs);                  /* Memory attributes        */
  498.             if (((ulAttrs & PAG_FREE) ||     /* If page is available     */
  499.                 (ulAttrs & PAG_COMMIT))==0)  /* but is not committed     */
  500.                {
  501.                DosSetMem(                    /* Commit page              */
  502.                   (PVOID)pX->ExceptionInfo[1], /* Page base address      */
  503.                   1L,                        /* Single page only         */
  504.                   PAG_DEFAULT |              /* Default attributes       */
  505.                   PAG_COMMIT);               /* Set commit flag          */
  506.                return(XCPT_CONTINUE_EXECUTION); /* Done                  */
  507.                }
  508.          }
  509.       if (pX->ExceptionNum ==                /* If access violation      */
  510.           XCPT_ACCESS_VIOLATION)
  511.          {
  512.          if (pX->ExceptionInfo[1])           /* If page address not NULL */
  513.             {
  514.             ulSize=1L;                       /* One page                 */
  515.             DosQueryMem(                     /* Query memory attributes  */
  516.                (PVOID)pX->ExceptionInfo[1],  /* Page base address        */
  517.                &ulSize,                      /* Single page              */
  518.                &ulAttribs);                  /* Memory attributes        */
  519.             if (((ulAttrs & PAG_FREE) ||     /* If page is available     */
  520.                 (ulAttrs & PAG_COMMIT))==0)  /* but is not committed     */
  521.                {
  522.                DosSetMem(                    /* Commit page              */
  523.                   (PVOID)pX->ExceptionInfo[1], /* Page base address      */
  524.                   1L,                        /* Single page only         */
  525.                   PAG_DEFAULT |              /* Default attributes       */
  526.                   PAG_COMMIT);               /* Set commit flag          */
  527.                return(XCPT_CONTINUE_EXECUTION); /* Done                  */
  528.                }
  529.             }
  530.          }
  531.       return(XCPT_CONTINUE_SEARCH);          /* Chain to next handler if */
  532. }                                            /* any other exception      */
  533.  
  534. This exception handler also handles the situation where an application writes 
  535. directly to an uncommitted page rather than to the guard page, as is possible 
  536. with non-sequential write operations. 
  537.  
  538.  
  539. ΓòÉΓòÉΓòÉ 6.15. Registering a Guard Page Exception Handler ΓòÉΓòÉΓòÉ
  540.  
  541. EXCEPTIONREGISTRATIONRECORD Exception;
  542.    :
  543.    :
  544. Exception.ExceptionHandler = (_ERR *)&GPHandler; /* Set entry point addr */
  545.  
  546. DosSetExceptionHandler(&Exception);              /* Register handler     */
  547.  
  548. This example shows the use of the DosSetExceptionHandler() function. 
  549.  
  550.  
  551. ΓòÉΓòÉΓòÉ 6.16. Suballocating Memory ΓòÉΓòÉΓòÉ
  552.  
  553. #define       POOLSIZE   8192              /* Size of storage pool       */
  554. PVOID         pPool;                       /* Base address of pool       */
  555.  
  556. CTRLSTRUCT1   *Struct1;                    /* Control structure 1        */
  557. CTRLSTRUCT2   *Struct2;                    /* Control structure 2        */
  558.  
  559. DosAllocMem(&pPool,                        /* Allocate storage for pool  */
  560.             POOLSIZE,                      /* Size of memory object      */
  561.             PAG_READ  |                    /* Allow read access          */
  562.             PAG_WRITE |                    /* Allow write access         */
  563.             PAG_COMMIT);                   /* Commit storage immediately */
  564.  
  565. DosSubSet(pPool,                           /* Initialize for suballoc    */
  566.           DOS_SUBINIT,                     /* Initialize flag            */
  567.           POOLSIZE);                       /* Size of pool               */
  568.  
  569. DosSubAlloc(pPool,                         /* Suballocate storage        */
  570.             &Struct1,                      /* Pointer to memory object   */
  571.             sizeof(CTRLSTRUCT1));          /* Size of storage required   */
  572. DosSubAlloc(pPool,                         /* Suballocate storage        */
  573.             &Struct2,                      /* Pointer to memory object   */
  574.             sizeof(CTRLSTRUCT2));          /* Size of storage required   */
  575.  
  576.  
  577. ΓòÉΓòÉΓòÉ 6.17. Allocating Shared Memory ΓòÉΓòÉΓòÉ
  578.  
  579. MYSTRUCT *MYSTRUCT;
  580. APIRET   rc;
  581.  
  582. rc = DosAllocSharedMem(&MyStruct,        /* Allocate memory object       */
  583.                        NULL,             /* Anonymous memory object      */
  584.                        sizeof(MYSTRUCT), /* Size of memory object        */
  585.                        OBJ_GIVEABLE |    /* Object is giveable           */
  586.                        PAG_WRITE    |    /* Write access is allowed      */
  587.                        PAG_READ     |    /* Read access is allowed       */
  588.                        PAG_COMMIT);      /* Commit storage immediately   */
  589.  
  590. rc = DosGiveSharedMem(MyStruct,          /* Give access to object        */
  591.                       pidOther,          /* Process to receive access    */
  592.                       PAG_WRITE |        /* Write access is allowed      */
  593.                       PAG_READ);         /* Read access is allowed       */
  594.  
  595. This example shows the use of the DosAllocSharedMem() function, declaring a 
  596. memory object as "giveable". 
  597.  
  598.  
  599. ΓòÉΓòÉΓòÉ 6.18. Sample Application Main Routine (Part 1) - Registration ΓòÉΓòÉΓòÉ
  600.  
  601. #define  INCL_WIN
  602. #include <os2.h>
  603.  
  604. #define  WCP_MAIN     "WCP_MAIN"
  605.  
  606. MRESULT EXPENTRY wpMain(HWND,ULONG,MPARAM,MPARAM);
  607.  
  608. int main()
  609. {
  610.     struct MYSTRUCT InitData;
  611.  
  612.     static CHAR szTitle[] = "Main Window";
  613.  
  614.     FRAMECDATA fcdata;                  /* Control data for window   */
  615.     HAB    hAB;                         /* Anchor block handle       */
  616.     HMQ    hMsgQ;                       /* Message queue handle      */
  617.     HWND   hFrame, hClient;             /* Window handles            */
  618.     QMSG   qMsg;                        /* Message queue structure   */
  619.     APIRET rc;                          /* Flag                      */
  620.  
  621.     hAB   = WinInitialize(0);           /* Register appl. to PM      */
  622.     hMsgQ = WinCreateMsgQueue(hAB,0);   /* Create message queue      */
  623.  
  624.     rc = WinRegisterClass(hAB,          /* Register window class     */
  625.                           WCP_MAIN,     /* Name of class             */
  626.                           wpMain,       /* Window procedure name     */
  627.                           0L,           /* No style                  */
  628.                           4);           /* 32 bits in window words   */
  629.  
  630.  
  631. ΓòÉΓòÉΓòÉ 6.19. Sample Application Main Routine (Part 2) - Window Creation ΓòÉΓòÉΓòÉ
  632.  
  633.     fcdata.flCreateFlags = FCF_TITLEBAR      |   FCF_SYSMENU   |
  634.                            FCF_SIZEBORDER    |   FCF_MINMAX    |
  635.                            FCF_SHELLPOSITION;
  636.  
  637.     hFrame=WinCreateWindow(HWND_DESKTOP,    /* Create frame window       */
  638.                            WC_FRAME,        /* Frame window class        */
  639.                            (PSZ)0,          /* No window text            */
  640.                            0L,              /* No style                  */
  641.                            0,0,0,0,         /* PM shell will position    */
  642.                            (HWND)0,         /* No owner                  */
  643.                            HWND_TOP,        /* On top of siblings        */
  644.                            0,               /* No window identifier      */
  645.                            &fcdata,         /* Frame control data        */
  646.                            0);              /* Presentation parameters   */
  647.     hClient=WinCreateWindow(hFrame,         /* Create client window      */
  648.                             WCP_MAIN,       /* Window class              */
  649.                             szTitle,        /* Window title              */
  650.                             01,             /* Standard style            */
  651.                             0,0,0,0,        /* PM shell will position    */
  652.                             (HWND)0,        /* No owner                  */
  653.                             HWND_TOP,       /* On top of siblings        */
  654.                             FID_CLIENT,     /* Client window identifier  */
  655.                             &InitData,      /* Initialization data       */
  656.                             0);             /* Presentation parameters   */
  657.  
  658.     /*    <Create Window List entry for application>                     */
  659.  
  660.     while (WinGetMsg(hAB, &qMsg, 0, 0, 0))
  661.           WinDispatchMsg(hAB, &qMsg);
  662.  
  663.     /*    <Remove Window List entry for application>                     */
  664.  
  665.     WinDestroyWindow(hFrame);               /* Destroy frame & children  */
  666.     WinDestroyMsgQueue(hMsgQ);              /* Destroy message queue     */
  667.     WinTerminate(hAB);                      /* Deregister application    */
  668. }
  669.  
  670.  
  671. ΓòÉΓòÉΓòÉ 6.20. WinAddSwitchEntry() Function ΓòÉΓòÉΓòÉ
  672.  
  673. SWCNTRL   SwitchData;                      /* Switch control data block  */
  674. HSWITCH  hSwitch;                          /* Switch entry handle        */
  675.    :
  676.    :
  677. SwitchData.hwnd = hFrame;                  /* Set frame window handle    */
  678. SwitchData.hwndIcon = 0;                   /* Use default icon           */
  679. SwitchData.hprog = 0;                      /* Use default program handle */
  680. SwitchData.idProcess = 0;                  /* Use current process id     */
  681. SwitchData.idSession = 0;                  /* Use current session id     */
  682. SwitchData.uchVisibility = SWL_VISIBLE;    /* Make visible               */
  683. SwitchData.fbJump = SWL_JUMPABLE;          /* Make jumpable via Alt+Esc  */
  684. SwitchData.szSwTitle[0] = '\0';            /* Use default title text     */
  685.  
  686. hSwitch = WinAddSwitchEntry(&SwitchData);  /* Add switch entry           */
  687.  
  688. This function adds the application to the OS/2 Window List. Note that under 
  689. OS/2 Version 2.0, the WinCreateSwitchEntry() function should be used. 
  690.  
  691.  
  692. ΓòÉΓòÉΓòÉ 6.21. Storing Instance Data in Window Words ΓòÉΓòÉΓòÉ
  693.  
  694. MYSTRUCT *MyStruct;
  695.    :
  696. switch (ulMsg)                              /* Switch on message class   */
  697.        {
  698.        case WM_CREATE:
  699.             WinDefWindowProc(hWnd,          /* Perform default init      */
  700.                              ulMsg,
  701.                              mp1,
  702.                              mp2);
  703.             DosAllocMem(MyStruct,           /* Allocate memory object    */
  704.                         sizeof(MYSTRUCT),   /* Size of memory object     */
  705.                         PAG_READ  |         /* Allow read access         */
  706.                         PAG_WRITE |         /* Allow write access        */
  707.                         PAG_COMMIT);        /* Commit storage now        */
  708.             hFrame=WinQueryWindow(hwnd,     /* Get frame window handle   */
  709.                                   QW_PARENT,
  710.                                   FALSE);
  711.             WinSetWindowULong(hFrame,       /* Place pointer in window   */
  712.                               QWL_USER,     /* words                     */
  713.                               (ULONG)MyStruct);
  714.             return((MRESULT)0);
  715.             break;
  716.               :
  717.  
  718. This example shows the allocation of a memory object, and the storage of a 
  719. pointer to that memory object in window words. 
  720.  
  721.  
  722. ΓòÉΓòÉΓòÉ 6.22. Retrieving Instance Data from Window Words ΓòÉΓòÉΓòÉ
  723.  
  724.        case WMP_MYMESSAGE:
  725.             hFrame=WinQueryWindow(hwnd,
  726.                                   QW_PARENT,
  727.                                   FALSE);
  728.             MyStruct=WinQueryWindowULong(hFrame,
  729.                                          QWL_USER);
  730.             <Perform action>
  731.             return((MRESULT)0);
  732.             break;
  733.               :
  734.  
  735.  
  736. ΓòÉΓòÉΓòÉ 6.23. Releasing Instance Data Storage ΓòÉΓòÉΓòÉ
  737.  
  738.        case WM_DESTROY:
  739.             hFrame=WinQueryWindow(hwnd,
  740.                                   QW_PARENT,
  741.                                   FALSE);
  742.             MyStruct=WinQueryWindowULong(hFrame,
  743.                                          QWL_USER);
  744.             <Release data objects>
  745.             <Release Presentation Manager resources>
  746.             DosFreeMem(MyStruct);
  747.             return((MRESULT)0);
  748.             break;
  749.               :
  750.  
  751.  
  752. ΓòÉΓòÉΓòÉ 6.24. WinSubclassWindow() Function ΓòÉΓòÉΓòÉ
  753.  
  754. PFNWP pOldWinProc;
  755.  
  756. pOldWinProc = WinSubclassWindow(hWnd, wpSubclass);
  757.  
  758.  
  759. ΓòÉΓòÉΓòÉ 6.25. Subclass Window Procedure ΓòÉΓòÉΓòÉ
  760.  
  761. MRESULT EXPENTRY wpSubclass(HWND   hWnd,
  762.                             ULONG  ulMsg,
  763.                             MPARAM mp1,
  764.                             MPARAM mp2)
  765. {
  766.         CHAR      szClass[7];
  767.         CLASSINFO WinClass;
  768.         PFNWP     pWinProc;
  769.  
  770.         BOOL      bSuccess;
  771.         ULONG     ulRetLength;
  772.  
  773.         switch (ulMsg)
  774.                {
  775.                case WMP_MESSAGE1:
  776.                          :
  777.                     <Perform application specific processing>
  778.                          :
  779.                     return((MRESULT)0);
  780.                     break;
  781.                case WMP_MESSAGE2:
  782.                          :
  783.                     <Perform application specific processing>
  784.                          :
  785.                     break;
  786.                default:
  787.                     break;
  788.                }
  789.         ulRetLength=WinQueryClassName(hWnd,
  790.                                       sizeof(szClass),
  791.                                       szClass);
  792.         bSuccess=WinQueryClassInfo(NULL,
  793.                                    szClass,
  794.                                    &WinClass);
  795.         pWinProc=WinClass.pfnWindowProc;
  796.         return((MRESULT)(*pWinProc)(hWnd,
  797.                                     ulMsg,
  798.                                     mp1,
  799.                                     mp2);
  800. }
  801.  
  802.  
  803. ΓòÉΓòÉΓòÉ 6.26. WinDlgBox() Function ΓòÉΓòÉΓòÉ
  804.  
  805. MYSTRUCT *MyStruct;
  806.    :
  807. DosAllocMem(MyStruct,                 /* Allocate memory object          */
  808.             sizeof(MYSTRUCT),         /* Size of memory object           */
  809.             PAG_READ  |               /* Allow read access               */
  810.             PAG_WRITE |               /* Allow write access              */
  811.             PAG_COMMIT);              /* Commit storage now              */
  812.  
  813. <Initialize values in MyStruct>       /* Set initialization data         */
  814.  
  815. rc = WinDlgBox(HWND_DESKTOP,          /* Desktop is parent               */
  816.                hwnd,                  /* Current window is owner         */
  817.                dpMyDialog,            /* Entry point of dialog procedure */
  818.                (HMODULE)0,            /* Resource is in EXE file         */
  819.                DC_MYDIALOG,           /* Dialog resource identifier      */
  820.                MyStruct);             /* Pointer to initialization data  */
  821.  
  822.  
  823. ΓòÉΓòÉΓòÉ 6.27. Communicating with a Control Window ΓòÉΓòÉΓòÉ
  824.  
  825. rc = WinSendDlgItemMsg(hDlgBox,                  /* Parent dialog box    */
  826.                        EF_PRODNAME,              /* Control identifier   */
  827.                        EM_SETTEXTLIMIT,          /* Message              */
  828.                        20,                       /* Message parameters   */
  829.                        0);
  830.  
  831.  
  832. ΓòÉΓòÉΓòÉ 6.28. Querying Information From a Control Window ΓòÉΓòÉΓòÉ
  833.  
  834. rc = WinQueryDlgItemText(hDlgBox,                  /* Parent dialog box  */
  835.                          EF_PRODNAME,              /* Control identifier */
  836.                          sizeof(szBuffer),         /* Size of buffer     */
  837.                          szBuffer);                /* Pointer to buffer  */
  838.  
  839.  
  840. ΓòÉΓòÉΓòÉ 6.29. Inserting an Item Into a List Box ΓòÉΓòÉΓòÉ
  841.  
  842.  hLBox = WinWindowFromID(hWnd,             /* Get list box window handle */
  843.                          LB_LIST);
  844.  
  845.  ulIndex = WinInsertLboxItem(hLBox,        /* Insert list box item       */
  846.                              LIT_END,      /* Insert at end of list      */
  847.                              szItemText);  /* Item text                  */
  848.  
  849.  
  850. ΓòÉΓòÉΓòÉ 6.30. Querying a Selected List Box Item ΓòÉΓòÉΓòÉ
  851.  
  852. hLBox = WinWindowFromID(hWnd,              /* Get list box window handle */
  853.                         LB_LIST);
  854.  
  855. ulIndex = WinQueryLboxSelectedItem(hLBox); /* Get index of selected item */
  856.  
  857. ulLength = WinQueryLboxItemText(hLBox,             /* Get item text      */
  858.                                 usIndex,           /* Index of item      */
  859.                                 szBuffer,          /* Text buffer        */
  860.                                 sizeof(szBuffer)); /* Max no. of chars   */
  861.  
  862.  
  863. ΓòÉΓòÉΓòÉ 6.31. WinMessageBox() Function ΓòÉΓòÉΓòÉ
  864.  
  865. rc = WinMessageBox(HWND_DESKTOP,         /* Desktop is parent            */
  866.                    hWnd,                 /* Current window is parent     */
  867.                    pszMsgText,           /* Pointer to message text      */
  868.                    "Open the File"       /* Message title                */
  869.                    0,                    /* Message box identifier       */
  870.                    MB_OKCANCEL   |       /* Include OK & Cancel buttons  */
  871.                    MB_DEFBUTTON1 |       /* Default to OK                */
  872.                    MB_HELP);             /* Include help button          */
  873.  
  874.  
  875. ΓòÉΓòÉΓòÉ 6.32. Obtaining a Window Handle - WinQueryWindow() Function ΓòÉΓòÉΓòÉ
  876.  
  877. hTarget = WinQueryWindow(hWnd,       /* Base window for relation  */
  878.                          QW_PARENT,  /* Relationship to base wndw */
  879.                          FALSE);     /* Do not lock window        */
  880.  
  881.  
  882. ΓòÉΓòÉΓòÉ 6.33. Obtaining a Window Handle - WinWindowFromID() Function ΓòÉΓòÉΓòÉ
  883.  
  884. hTarget = WinWindowFromID(hMainFrame,  /* Parent window known     */
  885.                           FID_CLIENT); /* Window identifier       */
  886.  
  887.  
  888. ΓòÉΓòÉΓòÉ 6.34. Obtaining a Window Handle Using the Switch Entry ΓòÉΓòÉΓòÉ
  889.  
  890. hSwitch = WinQuerySwitchHandle(hWnd,0);
  891. ulSuccess = WinQuerySwitchEntry(hSwitch,
  892.                                 SwitchData);
  893. hTarget = WinWindowFromID(SwitchData.hwnd,
  894.                           FID_CLIENT);
  895.  
  896.  
  897. ΓòÉΓòÉΓòÉ 6.35. WinBroadcastMsg() Function ΓòÉΓòÉΓòÉ
  898.  
  899. rc = WinBroadcastMsg(hwnd,                    /* Current is parent       */
  900.                      WMP_MYMESSAGE,           /* Message identifier      */
  901.                      mp1,                     /* 1st message parameter   */
  902.                      mp2,                     /* 2nd message parameter   */
  903.                      BMSG_POST);              /* Post message via queue  */
  904.  
  905.  
  906. ΓòÉΓòÉΓòÉ 6.36. Calling External Macros ΓòÉΓòÉΓòÉ
  907.  
  908. #define INCL_REXXSAA
  909.  
  910. #include <rexxsaa.h>
  911.    :
  912. PSZ szFileName;                                 /* File to be accessed   */
  913. PSZ szOptions;                                  /* Command arguments     */
  914.  
  915. RXSTRING arg;                                   /* REXX argument string  */
  916. RXSTRING RexxRetValue;                          /* Result                */
  917.  
  918. LONG lRexxRC;                                   /* REXX return code      */
  919.  
  920. static RXSYSEXIT ExitList[] = {{"TIXXSIO", RXSIO}, /* Exit handler       */
  921.                                {NULL, RXENDLST}};
  922.    :
  923. arg.strptr = szOptions;                         /* Set argument string   */
  924. arg.strlength = strlen(szOptions);              /* Size of arg string    */
  925.  
  926. rc = RexxStart(1,                               /* Call REXX           */
  927.                &arg,                            /* Argument string     */
  928.                (PSZ)"RexxProc",                 /* REXX proc file      */
  929.                NULL,                            /* Procedure in file   */
  930.                (PSZ)"TIXX",                     /* ADDRESS environment */
  931.                (SHORT)RXCOMMAND,                /* REXX command        */
  932.                (PRXSYSEXIT)ExitList,            /* Exit list routines  */
  933.                &lRexxRC,                        /* Return code address */
  934.                &RexxRetValue);                  /* Returned result     */
  935.  
  936. This example shows the use of the RexxStart() function to call the REXX command 
  937. interpreter from within an application. 
  938.  
  939.  
  940. ΓòÉΓòÉΓòÉ 6.37. Workplace Shell Inheritance Hierarchy ΓòÉΓòÉΓòÉ
  941.  
  942.  
  943. ΓòÉΓòÉΓòÉ 6.38. Invoking a Method ΓòÉΓòÉΓòÉ
  944.  
  945. PWFolder *somSelf;                              /* Pointer to self       */
  946. PSZ      szTitle;                               /* Title string          */
  947.  
  948. _wpSetTitle(somSelf,szTitle);                   /* Set title string      */
  949.  
  950.  
  951. ΓòÉΓòÉΓòÉ 6.39. Overriding an Existing Method ΓòÉΓòÉΓòÉ
  952.  
  953. SOM_Scope BOOL SOMLINK pwfolder_wpSetTitle(PWFolder *somSelf,
  954.                                            PSZ pszNewTitle)
  955. {
  956.     CHAR szBuf[100];                            /* Character buffer      */
  957.  
  958.     PWFolderData *somThis =                     /* Get instance data     */
  959.                  PWFolderGetData(somSelf);
  960.     PWFolderMethodDebug("PWFolder",             /* Set debug info        */
  961.                         "pwfolder_wpSetTitle");
  962.  
  963.     strcpy(szBuf,pszNewTitle);                  /* Get current title     */
  964.  
  965.     if ((strcmp(_szCurrentPassword,             /* If folder is locked   */
  966.                 _szPassword)) != 0)
  967.         if((strstr(szBuf,"LOCKED")) == NULL )   /* and <LOCKED> not in   */
  968.                                                 /* current title         */
  969.           strcat(szBuf," <LOCKED>");            /* Add <LOCKED> to title */
  970.  
  971.     return(parent_wpSetTitle(somSelf,           /* Allow default proc to */
  972.                               szBuf));          /* occur                 */
  973. }
  974.  
  975. This example shows the _wpSetTitle method being overridden to add the word 
  976. "LOCKED" to the end of the title of a locked password-protected folder. 
  977.  
  978.  
  979. ΓòÉΓòÉΓòÉ 6.40. Adding a New Method ΓòÉΓòÉΓòÉ
  980.  
  981. SOM_Scope BOOL SOMLINK pwfolder_LockFolder(PWFolder *somSelf)
  982. {
  983.     HPTR  hLockedIcon;
  984.  
  985.     PWFolderData *somThis =                     /* Get instance data     */
  986.                  PWFolderGetData(somSelf);
  987.     PWFolderMethodDebug("PWFolder",             /* Set debug info        */
  988.                         "pwfolder_LockFolder");
  989.  
  990.     strcpy(_szCurrentPassword,                  /* Invalidate current    */
  991.            "NOPASSWD");                         /* password              */
  992.     _wpSetTitle(somSelf,                        /* Set title             */
  993.                 _wpQueryTitle(somSelf) );
  994.  
  995.     hLockedIcon = WinLoadPointer(HWND_DESKTOP,  /* Load "lock" icon      */
  996.                                  (HMODULE)0,
  997.                                  LOCK);
  998.  
  999.     _wpSetIcon(somSelf,                         /* Set icon to locked    */
  1000.                hLockedIcon);                    /* appearance            */
  1001.  
  1002.     return((BOOL)0);                            /* Return                */
  1003. }
  1004.  
  1005.  
  1006. ΓòÉΓòÉΓòÉ 6.41. Adding an Item to a Context Menu ΓòÉΓòÉΓòÉ
  1007.  
  1008. #define MI_LOCK     WPMENUID_USER+1
  1009.    :
  1010.    :
  1011. SOM_Scope BOOL SOMLINK pwfolder_wpModifyPopupMenu(PWFolder *somSelf,
  1012.                                                   HWND hwndMenu,
  1013.                                                   HWND hwndCnr,
  1014.                                                   ULONG iPosition)
  1015. {
  1016.     PWFolderData *somThis =                     /* Get instance data     */
  1017.                  PWFolderGetData(somSelf);
  1018.     PWFolderMethodDebug("PWFolder",             /* Set debug info        */
  1019.                         "pwfolder_wpModifyPopupMenu");
  1020.  
  1021.     _wpInsertPopupMenuItems(somSelf,            /* Insert menu item      */
  1022.                             hwndMenu,           /* Menu handle           */
  1023.                             iPosition,          /* Default position      */
  1024.                             hModule,            /* Module handle         */
  1025.                             MI_LOCK,            /* Menu item id          */
  1026.                             0);                 /* No submenu id         */
  1027.  
  1028.     return(parent_wpModifyPopupMenu(somSelf,    /* Allow default proc to */
  1029.                                     hwndMenu,   /* occur                 */
  1030.                                     hwndCnr,
  1031.                                     iPosition));
  1032. }
  1033.  
  1034.  
  1035. ΓòÉΓòÉΓòÉ 6.42. Invoking a Method via a Context Menu Item ΓòÉΓòÉΓòÉ
  1036.  
  1037. SOM_Scope void SOMLINK pwfolder_wpMenuItemSelected(PWFolder *somSelf,
  1038.                                                    HWND hwndFrame,
  1039.                                                    ULONG MenuId)
  1040. {
  1041.     PWFolderData *somThis =                     /* Get instance data     */
  1042.                  PWFolderGetData(somSelf);
  1043.     PWFolderMethodDebug("PWFolder",             /* Set debug info        */
  1044.                         "pwfolder_wpMenuItemSelected");
  1045.  
  1046.     switch (MenuId)                             /* Switch on item id     */
  1047.            {
  1048.            case MI_LOCK:                        /* If "Lock" item        */
  1049.                 _LockFolder(somSelf);           /* Lock folder           */
  1050.                 break;
  1051.            default:                                  /* else             */
  1052.                 parent_wpMenuItemSelected(somSelf,   /* Allow default    */
  1053.                                           hwndFrame, /* processing to    */
  1054.                                           MenuId);   /* occur            */
  1055.                 break;
  1056.            }
  1057.     return;
  1058. }
  1059.  
  1060.  
  1061. ΓòÉΓòÉΓòÉ 6.43. Class Method Example ΓòÉΓòÉΓòÉ
  1062.  
  1063. PSZ szDefaultClassTitle = "Password Folder";
  1064.  
  1065. /*
  1066.  *
  1067.  *  METHOD: wpclsQueryTitle                               PUBLIC
  1068.  *
  1069.  *  PURPOSE:
  1070.  *    Return the string "Password Folder"
  1071.  *
  1072.  */
  1073. #undef SOM_CurrentClass
  1074. #define SOM_CurrentClass M_PWFolderCClassData.parentMtab
  1075. SOM_Scope PSZ SOMLINK pwfoldercls_wpclsQueryTitle(M_PWFolder *somSelf)
  1076. {
  1077.     /* M_PWFolderData *somThis = M_PWFolderGetData(somSelf); */
  1078.     M_PWFolderMethodDebug("M_PWFolder","pwfoldercls_wpclsQueryTitle");
  1079.  
  1080.     return(szDefaultClassTitle);
  1081. }
  1082.  
  1083. This example shows an overridden class method _wpclsQueryTitle, which is 
  1084. modified to supply a default title for an object within the class. 
  1085.  
  1086.  
  1087. ΓòÉΓòÉΓòÉ 6.44. Invoking a Method in Another Object Class ΓòÉΓòÉΓòÉ
  1088.  
  1089. SOMAny *RecordClass;                            /* Class object pointer  */
  1090. somID  idQueryMethod;                           /* Method id             */
  1091.  
  1092. CHAR   szQueryBuffer[100];                      /* Query data buffer     */
  1093. PVOID  pFindData;                               /* Returned data buffer  */
  1094.    :
  1095.    :
  1096. rc = DosAllocSharedMem(&pFindData,              /* Alloc shared memory   */
  1097.                        NULL,                    /* No name               */
  1098.                        sizeof(szQueryBuffer)+1, /* Size of memory object */
  1099.                        OBJ_GIVEABLE  |          /* Make object giveable  */
  1100.                        PAG_WRITE     |          /* Allow write access    */
  1101.                        PAG_READ      |          /* Allow read access     */
  1102.                        PAG_COMMIT);             /* Commit storage now    */
  1103.  
  1104. strcpy(pFindData,szQueryBuffer);                /* Copy data to buffer   */
  1105.  
  1106. RecordClass = _somFindClass(SOMClassMgrObject,  /* Get class obj pointer */
  1107.                             SOM_IdFromString("Record"),
  1108.                                              1,1));
  1109. idQueryMethod = SOM_IdFromString("clsQuery");   /* Get method id         */
  1110.  
  1111. _somDispatchL(RecordClass,                      /* Invoke method         */
  1112.               idQueryMethod,                    /* Method id             */
  1113.               (void *)0,                        /* No descriptor string  */
  1114.               pFindData,                        /* Method parameters     */
  1115.               somSelf);
  1116.  
  1117.  
  1118. ΓòÉΓòÉΓòÉ 6.45. A SOM Precompiler-generated Function Stub ΓòÉΓòÉΓòÉ
  1119.  
  1120. /*
  1121.  *
  1122.  *  METHOD:   QueryInfo                                   PRIVATE
  1123.  *
  1124.  *  PURPOSE:  Copy the PWFolder instance data into
  1125.  *            the PWF_INFO structure that pPWFolderInfo
  1126.  *            points to.
  1127.  *                           ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇ2
  1128.  */                          Γöé                           ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ3
  1129.                                                         .
  1130. SOM_Scope BOOL     SOMLINK pwFolder_QueryInfo(PWFolder *somSelf,
  1131.                                PPWF_INFO pPWFolderInfo)
  1132. {              ΓööΓöÇΓöÇΓöÇ1
  1133.     PWFolderData *somThis = PWFolderGetData(somSelf); 4
  1134.     PWFolderMethodDebug("PWFolder","pwfolder_QueryInfo"); 5
  1135.  
  1136.     <application logic> 6
  1137.  
  1138.     return((BOOL)0);
  1139. }             
  1140.               ΓööΓöÇΓöÇΓöÇΓöÇ7
  1141.  
  1142. Notes: 
  1143.  
  1144. 1 SOM_Scope declares the function scope according to the language being used. 
  1145. For example, in C++, SOM_Scope would be defined as extern C but in C it is 
  1146. simply defined as extern. 
  1147.  
  1148. 2 It can be seen that the external prefix "pwfolder_", which was specified in 
  1149. the class definition file, has been placed in front of the function as 
  1150. expected.  Note that the SOM Precompiler generates a macro for this function in 
  1151. the private header file: 
  1152.  
  1153.    #define _QueryInfo PWFolder_QueryInfo
  1154.  
  1155. This avoids the necessity for the programmer to type the full function name, 
  1156. and helps make the code more readable. 
  1157.  
  1158. 3 Since SOM uses the C language, methods from SOM objects cannot be referenced 
  1159. in a very elegant manner.  The first parameter to a SOM method must be a 
  1160. pointer to an object that can invoke that method.  In the actual method 
  1161. function, this pointer is given the name somSelf.  For example, the difference 
  1162. between C and C++ is as follows: 
  1163.  
  1164.    /* Let us say */
  1165.  
  1166.         pMyObject =  (pointer to an object);
  1167.  
  1168.    // in C++ the following syntax may be used
  1169.  
  1170.         pMyObject->Method(param1, param2....);
  1171.  
  1172.    /* but in C the following is required */
  1173.  
  1174.         Method(pMyObject, param1, param2....);
  1175.  
  1176. 4 This statement uses the pointer to the object to initialize a pointer to 
  1177. access the object's instance data.  See Methods (Method Processing and Instance 
  1178. Data) for further information on instance data. 
  1179.  
  1180. 5 This line will perform tracing.  Tracing is switched on whenever the SOM 
  1181. global variable SOM_TraceLevel is set to a non-zero value. 
  1182.  
  1183. 6 This section is left blank by the SOM Precompiler for the developer to fill 
  1184. with the applicaton logic.  This logic may include access to system and/or 
  1185. Presentation Manager resources.  For the password-protected folder example, the 
  1186. _QueryInfo method must copy the instance variables to the PWF_INFO data 
  1187. structure defined in the passthru section of the class definition file. The 
  1188. code required to do this is as follows: 
  1189.  
  1190.    strcpy(pPWFolderInfo->szPassword, _szPassword);
  1191.    strcpy(pPWFolderInfo->szCurrentPassword, _szCurrentPassword);
  1192.    strcpy(pPWFolderInfo->szUserid, _szUserid);
  1193.  
  1194. This code must be inserted in the C source file by the programmer, after the 
  1195. file is generated by the SOM Precompiler.  This may be done using a normal text 
  1196. editor. 
  1197.  
  1198. 7 Finally, the SOM Precompiler provides a default zero return statement, 
  1199. typecast with the return data type of the method as declared in the methods 
  1200. section of the class definition file.  This statement may be altered by the 
  1201. programmer if required, provided that consistency with the method's prototype 
  1202. and declaration is maintained. 
  1203.  
  1204.  
  1205. ΓòÉΓòÉΓòÉ 6.46. Registering a Workplace Shell Object Class ΓòÉΓòÉΓòÉ
  1206.  
  1207. PSZ  pszClassName = "NewObject";                /* Class name            */
  1208. PSZ  pszModName = "NEWOBJ";                     /* DLL module for class  */
  1209. BOOL bSuccess;                                  /* Success flag          */
  1210.  
  1211. bSuccess = WinRegisterObjectClass(pszClassName, /* Register class        */
  1212.                                   pszModName);  /* DLL module name       */
  1213.  
  1214.  
  1215. ΓòÉΓòÉΓòÉ 6.47. Initializing Class Data ΓòÉΓòÉΓòÉ
  1216.  
  1217. HMODULE   hModule;
  1218.    :
  1219.    :
  1220. SOM_Scope void SOMLINK pwfoldercls_wpclsInitData(M_PWFolder *somSelf)
  1221. {
  1222.     CHAR  ErrorBuffer[100];                     /* Error buffer          */
  1223.  
  1224.     /* M_PWFolderData *somThis =
  1225.                       M_PWFolderGetData(somSelf); */
  1226.     M_PWFolderMethodDebug("M_PWFolder",         /* Set debug info        */
  1227.                           "pwfoldercls_wpclsInitData");
  1228.  
  1229.     DosLoadModule((PSZ) ErrorBuffer,            /* Get module handle     */
  1230.                   sizeof(ErrorBuffer),          /* Size of error buffer  */
  1231.                   "PWFOLDER",                   /* Name of DLL           */
  1232.                   &hModule);                    /* Module handle         */
  1233.  
  1234.     parent_wpclsInitData(somSelf);              /* Allow default proc    */
  1235. }
  1236.  
  1237.  
  1238. ΓòÉΓòÉΓòÉ 6.48. Freeing Class Data Items ΓòÉΓòÉΓòÉ
  1239.  
  1240. SOM_Scope void   SOMLINK pwfoldercls_wpclsUnInitData(M_PWFolder *somSelf)
  1241. {
  1242.     /* M_PWFolderData *somThis
  1243.                       = M_PWFolderGetData(somSelf); */
  1244.     M_PWFolderMethodDebug("M_PWFolder",         /* Set debug info        */
  1245.                           "pwfoldercls_wpclsUnInitData");
  1246.  
  1247.     DosFreeModule(hModule);                     /* Free module handle    */
  1248.  
  1249.     parent_wpclsUnInitData(somSelf);            /* Allow default proc    */
  1250. }
  1251.  
  1252.  
  1253. ΓòÉΓòÉΓòÉ 6.49. Creating an Object ΓòÉΓòÉΓòÉ
  1254.  
  1255. PSZ  pszClassName   = "NewObject";              /* Class name            */
  1256. PSZ  pszObjectTitle = "My New Object";          /* Object title          */
  1257. PSZ  pszParams = "ICON=C:\\ICONS\\MYNEWICON.ICO"; /* Setup string        */
  1258. PSZ  pszLocation = "C:\\Desktop\\MyNewFolder";  /* Location for object   */
  1259.  
  1260. ULONG ulFlags;                                  /* Creation flags        */
  1261.  
  1262. HOBJECT hObject;                                /* Object handle         */
  1263.  
  1264. hObject = WinCreateObject(pszClassName,         /* Create object         */
  1265.                           pszObjTitle,          /* Title for icon        */
  1266.                           pszParams,            /* Setup string          */
  1267.                           pszLocation,          /* Location for object   */
  1268.                           CO_REPLACEIFEXISTS);  /* Creation flags        */
  1269.  
  1270.  
  1271. ΓòÉΓòÉΓòÉ 6.50. Object Setup ΓòÉΓòÉΓòÉ
  1272.  
  1273. SOM_Scope BOOL SOMLINK pwfolder_wpSetup(PWFolder *somSelf,
  1274.                                         PSZ pszSetupString)
  1275. {
  1276.     CHAR  pszInitPword[20];                     /* Buffer for password   */
  1277.     BOOL  bFound;                               /* Success flag          */
  1278.     ULONG ulRetLength;
  1279.  
  1280.     PWFolderData *somThis =                     /* Get instance data     */
  1281.                  PWFolderGetData(somSelf);
  1282.     PWFolderMethodDebug("PWFolder",             /* Set debug info        */
  1283.                         "pwfolder_wpSetup");
  1284.  
  1285.     if (pszSetupString != NULL)                 /* If string is present  */
  1286.        {
  1287.        bFound=_wpScanSetupString(somSelf,        /* Scan setup string to */
  1288.                                  pszSetupString, /* find keyword         */
  1289.                                  "PASSWORD"
  1290.                                  pszInitPword,
  1291.                                  &RetLength);
  1292.  
  1293.        if (bFound)                              /* If parameter present  */
  1294.           {
  1295.           strcpy(_szPassword,                   /* Copy p'word to folder */
  1296.                  pszInitPword);                 /* p'word and current    */
  1297.           strcpy(_szCurrentPassword,            /* p'word - initialize   */
  1298.                  pszInitPword);                 /* in unlocked state     */
  1299.           }
  1300.        }
  1301.     return (parent_wpSetup(somSelf,             /* Allow default proc to */
  1302.                            pszSetupString));    /* occur                 */
  1303. }
  1304.  
  1305. This example shows an overridden _wpSetup method which parses the setup string 
  1306. to extract class-specific parameters. 
  1307.  
  1308.  
  1309. ΓòÉΓòÉΓòÉ 6.51. Initializing Instance Data ΓòÉΓòÉΓòÉ
  1310.  
  1311. SOM_Scope void SOMLINK pwfolder_wpInitData(PWFolder *somSelf)
  1312. {
  1313.     CHAR  ErrorBuffer[100];                     /* Error data buffer     */
  1314.  
  1315.     PWFolderData *somThis =                     /* Get instance data     */
  1316.                  PWFolderGetData(somSelf);
  1317.     PWFolderMethodDebug("PWFolder",             /* Set debug info        */
  1318.                         "pwfolder_wpInitData");
  1319.  
  1320.     strcpy(_szCurrentPassword,                  /* Initialize folder     */
  1321.            "password");                         /* password              */
  1322.     strcpy(_szPassword,                         /* Set current password  */
  1323.            "password");                         /* to folder password    */
  1324.                                                 /* ie. Set unlocked      */
  1325.  
  1326.     return(parent_wpInitData(somSelf));         /* Perform default proc  */
  1327. }
  1328.  
  1329.  
  1330. ΓòÉΓòÉΓòÉ 6.52. Opening an Object ΓòÉΓòÉΓòÉ
  1331.  
  1332. SOM_Scope HWND SOMLINK pwfolder_wpOpen(PWFolder *somSelf,
  1333.                                        HWND hwndCnr,
  1334.                                        ULONG ulView,
  1335.                                        ULONG param)
  1336. {
  1337.     ULONG ulResult;
  1338.     CHAR  szTitle[100];
  1339.  
  1340.     PWFolderData *somThis =
  1341.                  PWFolderGetData(somSelf);      /* Set instance data     */
  1342.     PWFolderMethodDebug("PWFolder",             /* Set debug info        */
  1343.                         "pwfolder_wpOpen");
  1344.  
  1345.     if ((strcmp(_szCurrentPassword,             /* If not locked         */
  1346.                 _szPassword)) == 0)
  1347.        return(parent_wpOpen(somSelf,            /* Allow open to proceed */
  1348.                             hwndCnr,            /* in normal way, using  */
  1349.                             ulView,             /* default processing    */
  1350.                             param));
  1351.  
  1352.     ulResult = WinDlgBox(HWND_DESKTOP,          /* Display p'word dialog */
  1353.                          HWND_DESKTOP,          /* Desktop is owner      */
  1354.                          dpPassword,            /* Dialog procedure      */
  1355.                          hModule,               /* Module handle         */
  1356.                          DLG_PASSWORD,          /* Dialog resource id    */
  1357.                          (PVOID)somSelf);       /* Object pointer        */
  1358.  
  1359.     if (ulResult == DID_OK)                     /* If not cancelled      */
  1360.        {
  1361.        if ((strcmp(_szCurrentPassword,          /* If correct password   */
  1362.                    _szPassword)) == 0)
  1363.           {
  1364.           strcpy(szTitle,                       /* Get title string      */
  1365.                  _wpQueryTitle(somSelf));
  1366.           szTitle[strlen(szTitle)-9] = '\0';    /* Remove <LOCKED>       */
  1367.           _wpSetTitle(somSelf,szTitle);         /* Reset title string    */
  1368.  
  1369.           <Set icon to unlocked state>
  1370.  
  1371.           return (parent_wpOpen(somSelf,        /* Allow default _wpOpen */
  1372.                                 hwndCnr,        /* processing to occur   */
  1373.                                 ulView,         /* by invoking parent's  */
  1374.                                 param));        /* method                */
  1375.           }
  1376.        else
  1377.           {
  1378.           WinMessageBox(HWND_DESKTOP,           /* Display message box   */
  1379.              HWND_DESKTOP,
  1380.              "Password incorrect. Folder remains locked.",
  1381.              "Password Failed",
  1382.              0, MB_OK | MB_CUAWARNING);
  1383.           return((BOOL)0);                      /* Return FALSE          */
  1384.           }
  1385.        }
  1386. }
  1387.  
  1388. This example shows the _wpOpen method, which is called by the system when a 
  1389. view of an object is opened, being overridden to add password protection to a 
  1390. folder. 
  1391.  
  1392.  
  1393. ΓòÉΓòÉΓòÉ 6.53. Opening a Custom View of an Object ΓòÉΓòÉΓòÉ
  1394.  
  1395. HWND    hView;                                  /* View window handle    */
  1396.  
  1397. typedef struct _OBJECTVIEW                      /* Object view structure */
  1398.                {
  1399.                SOMAny   *Object;                /* Object pointer        */
  1400.                USEITEM  UseItem;                /* USEITEM structure     */
  1401.                VIEWITEM ViewItem;               /* VIEWITEM structure    */
  1402.                } OBJECTVIEW;
  1403.  
  1404. OBJECTVIEW *pObjectView;                        /* Pointer to structure  */
  1405.  
  1406. <Create Window>                                 /* Get window handle     */
  1407.  
  1408. pObjectView = _wpAllocMem(somSelf,              /* Allocate memory       */
  1409.                           sizeof(OBJECTVIEW),   /* Size of mem object    */
  1410.                           NULL);
  1411. pObjectView->Record          = somSelf;         /* Initialize OBJECTVIEW */
  1412. pObjectView->UseItem.type    = USAGE_OPENVIEW;  /* structure             */
  1413. pObjectView->ViewItem.view   = OPEN_CUST;
  1414. pObjectView->ViewItem.handle = hView;
  1415.  
  1416. WinSetWindowULong(hView,                        /* Store pointer to      */
  1417.                   QWL_USER,                     /* structure in window   */
  1418.                   (ULONG)pObjectView);          /* words                 */
  1419.  
  1420. _wpAddToObjUseList(somSelf,                     /* Add to Use List       */
  1421.                    &pObjectView->UseItem);      /* USEITEM structure     */
  1422. _wpRegisterView(somSelf,                        /* Register view         */
  1423.                 hView,                          /* View window handle    */
  1424.                 "Customer Details")             /* Title of view         */
  1425.  
  1426.  
  1427. ΓòÉΓòÉΓòÉ 6.54. Automatically Instantiating an Object ΓòÉΓòÉΓòÉ
  1428.  
  1429. PSZ  pszClassName   = "NewObject";              /* Class name            */
  1430. PSZ  pszObjectTitle = "My New Object";          /* Object title          */
  1431. PSZ  pszParams = "OPEN=ICON";                   /* Setup string          */
  1432. PSZ  pszLocation = "C:\\Desktop\\MyNewFolder";  /* Location for object   */
  1433.  
  1434. ULONG ulFlags = CO_UPDATEIFEXISTS;              /* Creation flags        */
  1435.  
  1436. HOBJECT hObject;                                /* Object handle         */
  1437.  
  1438. hObject = WinCreateObject(pszClassName,         /* Create object         */
  1439.                           pszObjTitle,          /* Title for icon        */
  1440.                           pszParams,            /* Setup string          */
  1441.                           pszLocation,          /* Location for object   */
  1442.                           ulFlags);             /* Creation flags        */
  1443.  
  1444. This example shows the use of the OPEN= keyword to automatically open a view of 
  1445. an object upon creating the object. 
  1446.  
  1447.  
  1448. ΓòÉΓòÉΓòÉ 6.55. Closing an Object ΓòÉΓòÉΓòÉ
  1449.  
  1450. SOM_Scope BOOL SOMLINK pwfolder_wpClose(PWFolder *somSelf)
  1451. {
  1452.     PWFolderData *somThis =                     /* Get instance data     */
  1453.                  PWFolderGetData(somSelf);
  1454.     PWFolderMethodDebug("PWFolder",             /* Set debug info        */
  1455.                         "pwfolder_wpInitData");
  1456.     _LockFolder(somSelf);                       /* Lock folder           */
  1457.  
  1458.     return(parent_wpClose(somSelf));            /* Allow default proc    */
  1459. }
  1460.  
  1461. This example shows the _wpClose method being overridden in order to provide 
  1462. class-specific processing for the password-protected folder. 
  1463.  
  1464.  
  1465. ΓòÉΓòÉΓòÉ 6.56. Saving an Object's State ΓòÉΓòÉΓòÉ
  1466.  
  1467. SOM_Scope BOOL SOMLINK pwfolder_wpSaveState(PWFolder *somSelf)
  1468. {
  1469.     PWFolderData *somThis =                     /* Get instance data     */
  1470.                  PWFolderGetData(somSelf);
  1471.     PWFolderMethodDebug("PWFolder",             /* Set debug info        */
  1472.                         "pwfolder_wpSaveState");
  1473.  
  1474.     _wpSaveString(somSelf,                      /* Save folder password  */
  1475.                   "PWFolder",                   /* Class name            */
  1476.                    1L,                          /* Class-defined key     */
  1477.                    _szPassword);                /* String to be saved    */
  1478.     _wpSaveString(somSelf,                      /* Save current password */
  1479.                   "PWFolder",                   /* Class name            */
  1480.                   2L,                           /* Class-defined key     */
  1481.                   _szCurrentPassword);          /* String to be saved    */
  1482.  
  1483.     return (parent_wpSaveState(somSelf));       /* Invoke default proc   */
  1484. }
  1485.  
  1486.  
  1487. ΓòÉΓòÉΓòÉ 6.57. Restoring an Object's State ΓòÉΓòÉΓòÉ
  1488.  
  1489. SOM_Scope BOOL32   SOMLINK pwfolder_wpRestoreState(PWFolder *somSelf,
  1490.                 ULONG ulReserved)
  1491. {
  1492.     ULONG ulResStrLen;                          /* String length         */
  1493.  
  1494.     PWFolderData *somThis =                     /* Get instance data     */
  1495.                  PWFolderGetData(somSelf);
  1496.     PWFolderMethodDebug("PWFolder",             /* Set debug info        */
  1497.                         "pwfolder_wpRestoreState");
  1498.  
  1499.     _wpRestoreString(somSelf,                   /* Restore folder p'word */
  1500.                      "PWFolder",                /* Class name            */
  1501.                      1L,                        /* Class-defined key     */
  1502.                      _szPassword,               /* Target string         */
  1503.                      &ulResStrLen);             /* Length restored       */
  1504.     _wpRestoreString(somSelf,                   /* Restore curr p'word   */
  1505.                      "PWFolder",                /* Class name            */
  1506.                      2L,                        /* Class-defined key     */
  1507.                      _szCurrentPassword,        /* Target string         */
  1508.                      &ulResStrLen);             /* Length restored       */
  1509.  
  1510.     return(parent_wpRestoreState(somSelf,       /* Invoke default proc   */
  1511.                                  ulReserved));
  1512. }
  1513.  
  1514.  
  1515. ΓòÉΓòÉΓòÉ 6.58. Destroying an Object ΓòÉΓòÉΓòÉ
  1516.  
  1517. HOBJECT hObject;                           /* Object handle              */
  1518. BOOL    bSuccess;                          /* Success flag               */
  1519.  
  1520. bSuccess = WinDestroyObject(hObject);      /* Destroy object             */
  1521.  
  1522.  
  1523. ΓòÉΓòÉΓòÉ 6.59. Deregistering an Object Class ΓòÉΓòÉΓòÉ
  1524.  
  1525. BOOL bSuccess;
  1526.  
  1527. bSuccess = WinDeregisterObjectClass(pszClassName);   /* Deregister class */
  1528.  
  1529.  
  1530. ΓòÉΓòÉΓòÉ 6.60. Creating a Transient Object ΓòÉΓòÉΓòÉ
  1531.  
  1532. REPLY *Reply;                                   /* Reply data structure  */
  1533.  
  1534. SOMAny *NewObj;                                 /* Object pointer        */
  1535.  
  1536. case WMP_REQUEST_COMPLETE:
  1537.      Reply = (REPLY *)mp1;                      /* Get reply data        */
  1538.  
  1539.      ClassID = SOM_IdFromString("CustClass");   /* Get class SOM ID      */
  1540.  
  1541.      TransClass = _somFindClass(SOMClassMgrObject, /* Get class pointer  */
  1542.                                 ClassID,        /* Class SOM ID          */
  1543.                                 1,1);           /* Major & minor version */
  1544.  
  1545.      NewObj = _wpclsNew(TransClass,             /* Create new object     */
  1546.                         Reply->CustName,        /* Title for object      */
  1547.                         "",                     /* No setup string       */
  1548.                         Reply->Folder,          /* Location              */
  1549.                         TRUE);                  /* Lock flag             */
  1550.  
  1551.      _SetCustInfo(NewObj,                       /* Set instance data     */
  1552.                   Reply);
  1553.      break;
  1554.  
  1555.  
  1556. ΓòÉΓòÉΓòÉ 6.61. Workplace Shell Application Structure ΓòÉΓòÉΓòÉ
  1557.  
  1558.  
  1559. ΓòÉΓòÉΓòÉ 6.62. Referencing an Object Using OBJECTID ΓòÉΓòÉΓòÉ
  1560.  
  1561. HOBJECT hObject;                                /* Object handle         */
  1562.  
  1563. /*************************************************************************/
  1564. /* Create a folder on the desktop with an OBJECTID of MYFOLDER           */
  1565. /*************************************************************************/
  1566.  
  1567. hObject = WinCreateObject("WPFolder",           /* Class Name            */
  1568.                           "My Folder",          /* Title                 */
  1569.                           "OBJECTID=<MYFOLDER>", /* Setup string         */
  1570.                           "<WP_DESKTOP>",       /* Location              */
  1571.                           CO_REPLACEIFEXISTS);  /* Create option         */
  1572.  
  1573. /*************************************************************************/
  1574. /* Create a file object with an OBJECTID of MYFILE inside the folder     */
  1575. /*************************************************************************/
  1576.  
  1577. hObject = WinCreateObject("WPDataFile",         /* Class Name            */
  1578.                           "My File",            /* Title                 */
  1579.                           "OBJECTID=<MYFILE>",  /* Setup string          */
  1580.                           "<MYFOLDER>",         /* Location              */
  1581.                           CO_REPLACEIFEXISTS);  /* Create option         */
  1582.  
  1583. /*************************************************************************/
  1584. /* Create a shadow of the file object MYFILE on the desktop              */
  1585. /*************************************************************************/
  1586.  
  1587. hObject = WinCreateObject("WPShadow",           /* Class Name            */
  1588.                           "My File",            /* Title                 */
  1589.                           "SHADOWID=<MYFILE>",  /* Setup string          */
  1590.                           "<WP_DESKTOP>",       /* Location              */
  1591.                           CO_REPLACEIFEXISTS);  /* Create option         */
  1592.  
  1593.  
  1594. ΓòÉΓòÉΓòÉ 6.63. Drag Initiation From a Container Window ΓòÉΓòÉΓòÉ
  1595.  
  1596. PCONTRECORD  pCRec;
  1597. PCNRDRAGINIT pcnrInit;
  1598. PDRAGINFO    pDInfo;
  1599. DRAGITEM     DItem;
  1600. DRAGIMAGE    DImage;
  1601.  
  1602. APIRET       rc;
  1603.   :
  1604.   :
  1605. case WM_CONTROL:
  1606.      switch (SHORT2FROMMP(mp1))
  1607.             {
  1608.             case CN_INITDRAG:
  1609.                  pcnrInit =                     /* Get container data    */
  1610.                     (PCNRDRAGINIT)mp2;
  1611.                  pCRec = (PCONTRECORD)pcnrInit->pRecord;
  1612.  
  1613.                  if (pCRec == NULL)             /* If no item selected   */
  1614.                     return(0);                  /* Return                */
  1615.  
  1616.                  pDInfo = DrgAllocDraginfo(1);  /* Allocate DRAGINFO     */
  1617.  
  1618.                  DItem.hwndItem = hWnd;         /* Initialize DRAGITEM   */
  1619.                  DItem.ulItemID = (ULONG)pCRec;
  1620.                  DItem.hstrType =
  1621.                     DrgAddStrHandle("DRT_CUSTOMER");
  1622.                  DItem.hstrRMF =
  1623.                     DrgAddStrHandle("(DRM_SHAREMEM,DRM_PRINT)x(DRF_TEXT)");
  1624.                  DItem.fsControl = 0;
  1625.                  DItem.fsSupportedOps = DO_COPYABLE | DO_MOVEABLE;
  1626.  
  1627.                  rc = DrgSetDragItem(pDInfo,    /* Set item in DRAGINFO  */
  1628.                          &DItem,                /* Pointer to DRAGITEM   */
  1629.                          sizeof(DItem),         /* Size of DRAGITEM      */
  1630.                          0);                    /* Index of DRAGITEM     */
  1631.  
  1632.                  DImage.cb = sizeof(DRAGIMAGE); /* Initialize DRAGIMAGE  */
  1633.                  DImage.cptl = 0;               /* Not a polygon         */
  1634.                  DImage.hImage = hPostIcon;     /* Icon handle for drag  */
  1635.                  DImage.fl = DRG_ICON;          /* Dragging an icon      */
  1636.                  DImage.cxOffset = 0;           /* No hotspot            */
  1637.                  DImage.cyOffset = 0;
  1638.  
  1639.                  hDrop = DrgDrag(hWnd,          /* Initiate drag         */
  1640.                             pDInfo,             /* DRAGINFO structure    */
  1641.                             (PDRAGIMAGE)&DImage, /* DRAGIMAGE structure  */
  1642.                             1,                  /* Only one DRAGIMAGE    */
  1643.                             VK_ENDDRAG,         /* End of drag indicator */
  1644.                             NULL);              /* Reserved              */
  1645.  
  1646.                  DrgFreeDragInfo(pDInfo);       /* Free DRAGINFO struct  */
  1647.                  break;
  1648.  
  1649. Another window class would perform these operations in response to a 
  1650. WM_BEGINDRAG message, rather than a WM_CONTROL message with the CN_INITDRAG 
  1651. indicator. 
  1652.  
  1653.  
  1654. ΓòÉΓòÉΓòÉ 6.64. Receiving a DM_PRINTOBJECT Message ΓòÉΓòÉΓòÉ
  1655.  
  1656. case DM_PRINTOBJECT:
  1657.      WinMessageBox(HWND_DESKTOP,                /* Display message box   */
  1658.                    hWnd,                        /* Curr window is owner  */
  1659.                    "Printing customer details", /* Message box text      */
  1660.                    "Print Message Received",    /* Message box title     */
  1661.                    0,                           /* No identifier         */
  1662.                    MB_OK);                      /* Include okay button   */
  1663.  
  1664.      <Extract DRAGITEM pointer from mp1>
  1665.      <Extract print queue name from mp2>
  1666.  
  1667.      <Print item>
  1668.  
  1669.      break;
  1670.  
  1671.  
  1672. ΓòÉΓòÉΓòÉ 6.65. Handling the DM_DRAGOVER Message ΓòÉΓòÉΓòÉ
  1673.  
  1674.   PDRAGITEM pDItem;                             /* Pointer to DRAGITEM   */
  1675.   PDRAGINFO pDInfo;                             /* Pointer to DRAGINFO   */
  1676.  
  1677.   case DM_DRAGOVER:
  1678.        pdinfo = (PDRAGINFO)mp1;                 /* Get DRAGINFO pointer  */
  1679.        DrgAccessDraginfo(pdinfo);               /* Access DRAGINFO       */
  1680.        pditem = DrgQueryDragitemPtr(pdinfo,     /* Access DRAGITEM       */
  1681.                                     0);         /* Index to DRAGITEM     */
  1682.        if (!DrgVerifyRMF(pditem,                /* Check valid rendering */
  1683.                         "DRM_SHAREMEM",         /* mechanisms and data   */
  1684.                         "DRF_TEXT"))            /* formats               */
  1685.           {
  1686.           DrgFreeDraginfo(pdinfo);              /* Free DRAGINFO         */
  1687.           return(MPFROM2SHORT(DOR_DROP,         /* Return okay to drop   */
  1688.                               DO_COPY));        /* Copy operation valid  */
  1689.           }
  1690.        else
  1691.           {
  1692.          DrgFreeDraginfo(pdinfo);               /* Free DRAGINFO         */
  1693.          return(MPFROM2SHORT(DOR_NEVERDROP,     /* Drop not valid        */
  1694.                              0));               /* No valid operations   */
  1695.           }
  1696.        break;
  1697.  
  1698.  
  1699. ΓòÉΓòÉΓòÉ 6.66. Handling the DM_DROP Message ΓòÉΓòÉΓòÉ
  1700.  
  1701. #define XFERMEM "\\SHAREMEM\\DragXfer.mem"      /* Shared mem obj name   */
  1702.  
  1703. PVOID     pCust;                                /* Customer record ptr   */
  1704.  
  1705. PDRAGITEM pDItem;                               /* DRAGITEM struct ptr   */
  1706. PDRAGINFO pDInfo;                               /* DRAGINFO struct ptr   */
  1707.   :
  1708. case DM_DROP:
  1709.      pDInfo = (PDRAGINFO)mp1;                   /* Get DRAGINFO pointer  */
  1710.      DrgAccessDraginfo(pDInfo);                 /* Access DRAGINFO       */
  1711.      pDItem = DrgQueryDragitemPtr(pdinfo,       /* Access DRAGITEM       */
  1712.                                   0);           /* Index to DRAGITEM     */
  1713.  
  1714.      DosAllocSharedMem(&pCust,                  /* Allocate shared mem   */
  1715.                        XFERMEM,                 /* Named memory object   */
  1716.                        sizeof(CUSTOMER),        /* Size of memory object */
  1717.                        PAG_COMMIT |             /* Commit storage now    */
  1718.                        PAG_WRITE  |             /* Allow write access    */
  1719.                        PAG_READ);               /* Allow read access     */
  1720.  
  1721.      pdxfer = DrgAllocDragtransfer(1);          /* Allocate DRAGTRANSFER */
  1722.      pdxfer->cb = sizeof(DRAGTRANSFER);         /* Init DRAGTRANSFER     */
  1723.      pdxfer->hwndClient = hWnd;
  1724.      pdxfer->pditem = pDItem;
  1725.      pdxfer->hstrSelectedRMF =
  1726.              DrgAddStrHandle("<DRM_CUSTOMER,DRF_TEXT>");
  1727.      pdxfer->hstrRenderToName =
  1728.              DrgAddStrHandle(XFERMEM);
  1729.      pdxfer->ulTargetInfo = 0;
  1730.      pdxfer->usOperation = DO_COPY;
  1731.  
  1732.      rc=DrgSendTransferMsg(pDInfo->hwndSource,  /* Send msg to source    */
  1733.                            DM_RENDER,           /* DM_RENDER message     */
  1734.                            (MPARAM)pdxfer,      /* DRAGTRANSFER pointer  */
  1735.                            NULL);
  1736.      if (rc == TRUE)                            /* If rendered okay      */
  1737.         {
  1738.         strcpy(msgtext, "Dialling number");     /* Build message text    */
  1739.         strncat(msgtext,
  1740.                 pxfercust->phone,
  1741.                 30);
  1742.         WinMessageBox(HWND_DESKTOP,             /* Display message box   */
  1743.                       hWnd,                     /* Curr window is owner  */
  1744.                       msgtext,                  /* Message text          */
  1745.                       "Telephone Dialler",      /* Message title         */
  1746.                       0,                        /* No identifier         */
  1747.                       MB_OK);                   /* Include okay button   */
  1748.  
  1749.         PhoneDial(pxfercust->phone);            /* Dial number           */
  1750.         }
  1751.  
  1752.      DrgFreeDragInfo(pdinfo);                   /* Release all data      */
  1753.      DrgFreeDragtransfer(pdxfer);               /* structures            */
  1754.      DosFreeMem((PVOID)pxfercust);
  1755.      break;
  1756.  
  1757.  
  1758. ΓòÉΓòÉΓòÉ 6.67. Handling the DM_RENDER Message ΓòÉΓòÉΓòÉ
  1759.  
  1760. PDRAGITEM     pDItem;                           /* DRAGITEM pointer      */
  1761. PDRAGINFO     pDInfo;                           /* DRAGINFO pointer      */
  1762. PDRAGTRANSFER pDXfer;                           /* DRAGTRANSFER pointer  */
  1763. PCONTRECORD   pCRec;                            /* Container record ptr  */
  1764. PCUSTOMER     pCust,                            /* Customer record ptrs  */
  1765.               pXferData;
  1766. CHAR          xfermem[100];                     /* Memory name buffer    */
  1767.  
  1768. HWND          hContainer;                       /* Container handle      */
  1769.   :
  1770.   :
  1771. case DM_RENDER:
  1772.      pDXfer = (PDRAGTRANSFER)mp1;               /* Get DRAGTRANSFER ptr  */
  1773.      pDItem = pDxfer->pditem;                   /* Get DRAGITEM ptr      */
  1774.      pCRec = pditem->ulItemID;                  /* Get container rec ptr */
  1775.      pCust = pCRec->cust;                       /* Get customer rec ptr  */
  1776.  
  1777.      DrgQueryStrName(pDXfer->hstrRenderToName,  /* Get mem object name   */
  1778.                      100,                       /* Size of buffer        */
  1779.                      xfermem);                  /* Buffer                */
  1780.  
  1781.      DosGetNamedSharedMem((PPVOID)&pXferData,   /* Get shared mem object */
  1782.                           xfermem,              /* Name of mem object    */
  1783.                           PAG_WRITE |           /* Allow write access    */
  1784.                           PAG_READ);            /* Allow read access     */
  1785.      memcpy(pCust,                              /* Copy customer record  */
  1786.             pXferData,                          /* to shared mem object  */
  1787.             sizeof(CUSTOMER));                  /* No. of bytes to copy  */
  1788.  
  1789.      DosFreeMem((PVOID)pCust);                  /* Free shared mem obj   */
  1790.  
  1791.      if (pDXfer->usOperation == DO_MOVE)        /* If move operation     */
  1792.         {
  1793.         hContainer = WinWindowFromID(hWnd,      /* Get container window  */
  1794.                         CONTAINER);             /* handle                */
  1795.         RemoveCustomer(hContainer,              /* Remove record from    */
  1796.                        pCRec);                  /* container             */
  1797.         }
  1798.      return((MRESULT)TRUE);                     /* Return TRUE           */
  1799.      break;
  1800.  
  1801.  
  1802. ΓòÉΓòÉΓòÉ 6.68. Menu Bar Resource Definition ΓòÉΓòÉΓòÉ
  1803.  
  1804. MENU MAIN      PRELOAD
  1805. BEGIN
  1806.      SUBMENU "~File",  MI_FILE, MIS_TEXT
  1807.      BEGIN
  1808.           MENUITEM "~New...",  MI_NEW, MIS_TEXT
  1809.           MENUITEM "~Open",    MI_OPEN, MIS_TEXT
  1810.           MENUITEM "~Save",    MI_SAVE, MIS_TEXT
  1811.           MENUITEM "Save ~as", MI_SAVEAS, MIS_TEXT
  1812.      END
  1813.      SUBMENU "~Edit", MI_EDIT, MIS_TEXT
  1814.      BEGIN
  1815.           MENUITEM "Cu~t",     MI_CUT, MIS_TEXT
  1816.           MENUITEM "~Copy",    MI_COPY, MIS_TEXT
  1817.           MENUITEM "~Paste",   MI_PASTE, MIS_TEXT
  1818.      END
  1819.      SUBMENU "~Window",        MI_WINDOW, MIS_TEXT
  1820.      BEGIN
  1821.           MENUITEM "~Tile",    MI_TILE, MIS_TEXT
  1822.           MENUITEM "~Cascade", MI_CASC, MIS_TEXT
  1823.      END
  1824.      MENUITEM "E~xit",         MI_EXIT, MIS_TEXT
  1825.      MENUITEM "~Help",         MI_HELP, MIS_HELP |
  1826.                                        MIS_BUTTONSEPARATOR
  1827. END
  1828.  
  1829.  
  1830. ΓòÉΓòÉΓòÉ 6.69. String Table Resource Definition ΓòÉΓòÉΓòÉ
  1831.  
  1832. STRINGTABLE MAIN     PRELOAD
  1833. BEGIN
  1834.      STR_MAINTITLE,     "Application Main Window"
  1835.      STR_LIST1,         "List of Objects"
  1836.      STR_MSGTITLE1,     "Title for Message Box"
  1837. END
  1838.  
  1839.  
  1840. ΓòÉΓòÉΓòÉ 6.70. Loading a Text String Resource ΓòÉΓòÉΓòÉ
  1841.  
  1842. ulLength = WinLoadString(hAB,              /* Load string             */
  1843.                          NULL,             /* From appl resource file */
  1844.                          STR_MAINTITLE,    /* String id in resource   */
  1845.                          sizeof(szTitle),  /* Number of characters    */
  1846.                          szTitle);         /* Target buffer           */
  1847.  
  1848.  
  1849. ΓòÉΓòÉΓòÉ 6.71. Accelerator Table Resource Definition ΓòÉΓòÉΓòÉ
  1850.  
  1851. ACCELTABLE CHILD1
  1852. BEGIN
  1853.      VK_F3,    MI_EXIT, VIRTUALKEY
  1854.      VK_F5,    MI_TILE, VIRTUALKEY, SHIFT
  1855.      "D",      MI_DELETE, CHAR, CONTROL
  1856. END
  1857.  
  1858.  
  1859. ΓòÉΓòÉΓòÉ 6.72. Window Template Resource Definition ΓòÉΓòÉΓòÉ
  1860.  
  1861. WINDOWTEMPLATE WCP_0001
  1862. BEGIN
  1863.      FRAME "Window Class X", 1, 10, 10, 320, 130
  1864.      CTLDATA FCF_STANDARD
  1865.      BEGIN
  1866.           WINDOW "", FID_CLIENT, 0,0,0,0, "MyClass", 01
  1867.      END
  1868. END
  1869.  
  1870.  
  1871. ΓòÉΓòÉΓòÉ 6.73. Dialog Template Resource Definition ΓòÉΓòÉΓòÉ
  1872.  
  1873. DLGTEMPLATE DC_CREATE
  1874. BEGIN
  1875.      DIALOG "Create an Object", DC_CREATE, 22, 32, 260, 76,,
  1876.      FCF_TITLEBAR | FCF_DLGBORDER
  1877.      BEGIN
  1878.           CONTROL "Enter the Object Name", -1, 7, 59, 246, 8, WC_STATIC,
  1879.           SS_TEXT | DT_CENTER | DT_TOP | WS_GROUP | WS_VISIBLE
  1880.           CONTROL "", 91, 43, 149, 8, WC_ENTRYFIELD,
  1881.           ES_MARGIN | ES_LEFT | WS_TABSTOP | WS_VISIBLE
  1882.           CONTROL "Enter", DID_OK, 38, 5, 38, 12, WC_BUTTON,
  1883.           BS_PUSHBUTTON | BS_DEFAULT | WC_TABSTOP | WC_VISIBLE
  1884.           CONTROL "Cancel", DID_CANCEL, 38, 5, 38, 12, WC_BUTTON,
  1885.           BS_PUSHBUTTON | WC_TABSTOP | WC_VISIBLE
  1886.      END
  1887. END
  1888.  
  1889.  
  1890. ΓòÉΓòÉΓòÉ 6.74. Resource Script File ΓòÉΓòÉΓòÉ
  1891.  
  1892. #include <os2.h>
  1893. #include "myappl.h"
  1894. #include "mydlg.h"
  1895.  
  1896. ICON     MAIN     APPLIC.ICO
  1897. ICON     CHILD1   CHILD1.ICO
  1898.  
  1899. BITMAP   INTRO    LOGO.BMP
  1900.  
  1901. STRINGTABLE MAIN     PRELOAD
  1902. BEGIN
  1903.      STR_MAINTITLE,     "Application Main Window"
  1904.      STR_LIST1,         "List of Objects"
  1905.      STR_MSGTITLE1,     "Title for Message Box"
  1906. END
  1907.  
  1908. MENU MAIN      PRELOAD
  1909. BEGIN
  1910.      SUBMENU "~File",  MI_FILE, MIS_TEXT
  1911.      BEGIN
  1912.           MENUITEM "~New...",  MI_NEW, MIS_TEXT
  1913.           MENUITEM "~Open",    MI_OPEN, MIS_TEXT
  1914.           MENUITEM "~Save",    MI_SAVE, MIS_TEXT
  1915.           MENUITEM "Save ~as", MI_SAVEAS, MIS_TEXT
  1916.      END
  1917.      SUBMENU "~Edit", MI_EDIT, MIS_TEXT
  1918.      BEGIN
  1919.           MENUITEM "Cu~t",     MI_CUT, MIS_TEXT
  1920.           MENUITEM "~Copy",    MI_COPY, MIS_TEXT
  1921.           MENUITEM "~Paste",   MI_PASTE, MIS_TEXT
  1922.      END
  1923.      MENUITEM "E~xit",         MI_EXIT, MIS_TEXT
  1924.      MENUITEM "~Help",         MI_HELP, MIS_HELP |
  1925.                                        MIS_BUTTONSEPARATOR
  1926. END
  1927.  
  1928. ACCELTABLE MAIN
  1929. BEGIN
  1930.      VK_F3,     MI_EXIT, VIRTUALKEY
  1931.      VK_F5,     MI_TILE, VIRTUALKEY, SHIFT
  1932.      "D",       MI_DELETE, CHAR, CONTROL
  1933. END
  1934. ACCELTABLE CHILD1
  1935. BEGIN
  1936.      VK_F1,    MI_HELP, VIRTUALKEY, HELP
  1937.      VK_F3,    MI_EXIT, VIRTUALKEY
  1938.      "D",      MI_DELETE, CHAR, CONTROL
  1939. END
  1940.  
  1941. rcinclude MYDLG.DLG
  1942.  
  1943.  
  1944. ΓòÉΓòÉΓòÉ 6.75. Loading Resources From a DLL ΓòÉΓòÉΓòÉ
  1945.  
  1946. rc = DosLoadModule(NULL,                  /* No object name           */
  1947.                    0,                     /* No object length         */
  1948.                    "MYDLL",               /* DLL module name          */
  1949.                    hModule);              /* DLL handle (returned)    */
  1950.  
  1951. ulLength = WinLoadString(hAB,             /* Load string              */
  1952.                          hModule,         /* DLL module handle        */
  1953.                          STR_TITLE,       /* Resource ID within DLL   */
  1954.                          sizeof(szTitle), /* Number of bytes          */
  1955.                          szTitle);        /* Target buffer            */
  1956.  
  1957.  
  1958. ΓòÉΓòÉΓòÉ 6.76. Loading a Dialog Resource From a DLL ΓòÉΓòÉΓòÉ
  1959.  
  1960. BOOL CustInfoDialog()
  1961. {
  1962.      HMODULE hModule;                       /* DLL module handle       */
  1963.      PFNWP   dpDlgProc;                     /* Dialog procedure addr   */
  1964.      USHORT  usResult;                      /* Result storage          */
  1965.  
  1966.      DosGetModuleHandle("WINDLL",           /* Get DLL module handle   */
  1967.                         hModule);
  1968.  
  1969.      DosGetProcAddr(hModule,                /* Get address of dialog   */
  1970.                     "dpCustDlg",            /* procedure               */
  1971.                     dpDlgProc);
  1972.  
  1973.      rc = WinDlgBox(HWND_DESKTOP,           /* Load & process dialog   */
  1974.                     NULL,                   /* No owner                */
  1975.                     dpDlgProc,              /* Dialog procedure addr   */
  1976.                     hModule,                /* DLL module handle       */
  1977.                     DC_CUSTDLG,             /* Dialog template id      */
  1978.                     NULL);                  /* No create parameters    */
  1979.  
  1980.      return(usResult);
  1981. }
  1982.  
  1983.  
  1984. ΓòÉΓòÉΓòÉ 6.77. Creating a Thread With an Object Window ΓòÉΓòÉΓòÉ
  1985.  
  1986. #define  STACKSIZE    8192
  1987.   :
  1988.   :
  1989. case WMP_DOLONGTASK:
  1990.      _beginthread(thread,             /* Entry point of thread routine   */
  1991.                   &Stack,             /* Pointer to stack memory object  */
  1992.                   STACKSIZE,          /* Size of stack memory object     */
  1993.                   (PVOID)hwnd);       /* Initialization data for thread  */
  1994.      break;
  1995.  
  1996.  
  1997. ΓòÉΓòÉΓòÉ 6.78. Secondary Thread Creating an Object Window ΓòÉΓòÉΓòÉ
  1998.  
  1999. void thread(HWND hWnd)
  2000. {
  2001.     HMQ  hMsgQ;                          /* Message queue handle      */
  2002.     HWND hWindow;                        /* Window handles            */
  2003.     QMSG qMsg;                           /* Message queue structure   */
  2004.  
  2005.     WinRegisterClass(hAB,                /* Register window class     */
  2006.                      WCP_OBJECT,         /* Class name                */
  2007.                      (PFNWP)wpObject,    /* Window procedure          */
  2008.                      0L,                 /* No class style            */
  2009.                      0);                 /* No extra window words     */
  2010.  
  2011.     hObject=WinCreateWindow(HWND_OBJECT, /* Create object window      */
  2012.                             WCP_OBJECT,  /* Object handle is parent   */
  2013.                             (PSZ)0,      /* No window text            */
  2014.                             0L,          /* No style                  */
  2015.                             0,0,0,0,     /* No position               */
  2016.                             NULL,        /* No owner                  */
  2017.                             HWND_TOP,    /* On top of siblings        */
  2018.                             0,           /* No window id              */
  2019.                             hWnd,        /* Handle in WM_CREATE       */
  2020.                             0);          /* No pres. parameters       */
  2021.  
  2022.     while (WinGetMsg(hAB,                /* Loop until WM_QUIT        */
  2023.                      &qMsg,
  2024.                      (ULONG)0,
  2025.                      0, 0))
  2026.            WinDispatchMsg(hAB, &qMsg);
  2027.  
  2028.     WinDestroyWindow(hObject);           /* Destroy object window     */
  2029.     WinDestroyMsgQueue(hMsgQ);           /* Destroy message queue     */
  2030.     _endthread();                        /* Terminate thread          */
  2031. }
  2032.  
  2033.  
  2034. ΓòÉΓòÉΓòÉ 6.79. Sample Object Window Procedure ΓòÉΓòÉΓòÉ
  2035.  
  2036. MRESULT EXPENTRY wpObject(HWND hWnd,
  2037.                          ULONG ulMsg,
  2038.                          MPARAM mp1,
  2039.                          MPARAM mp2)
  2040. {
  2041.         HWND     hNotify;
  2042.         HWND     hObject;
  2043.  
  2044.         switch (ulMsg)
  2045.                {
  2046.                case WM_CREATE:
  2047.                     WinDefWindowProc(hWnd,
  2048.                                      usMsg,
  2049.                                      mp1,
  2050.                                      mp2);
  2051.                     <initialize instance data>
  2052.                     <open data objects>
  2053.  
  2054.                     hNotify=HWNDFROMMP(mp1);
  2055.                     hObject=MPFROMHWND(hWnd);
  2056.                     WinPostMsg(hNotify,
  2057.                                WMP_NOTIFY,
  2058.                                hObject,
  2059.                                0);
  2060.  
  2061.                     return((MRESULT)FALSE);
  2062.                     break;
  2063.                case WMP_PUTDATA:
  2064.                     <put data into database>
  2065.                     <post message to logging object>
  2066.                     return((MRESULT)TRUE);
  2067.                     break;
  2068.                case WMP_GETDATA:
  2069.                     <get data from database>
  2070.                     <post data to caller in message>
  2071.                     return((MRESULT)TRUE);
  2072.                     break;
  2073.                case WM_DESTROY:
  2074.                     <close data objects>
  2075.                     <free any instance data areas>
  2076.                     return((MRESULT)0);
  2077.                     break;
  2078.                default:
  2079.                     return(WinDefWindowProc(hWnd,
  2080.                                             ulMsg,
  2081.                                             mp1,
  2082.                                             mp2));
  2083.                }
  2084. }
  2085.  
  2086.  
  2087. ΓòÉΓòÉΓòÉ 6.80. Creating a Thread Without an Object Window ΓòÉΓòÉΓòÉ
  2088.  
  2089. case WMP_THREAD:
  2090.      usReturn=DosCreateThread(ThreadID,    /* Create thread              */
  2091.                  ThreadRoutine,            /* Routine to run in thread   */
  2092.                  &InitData,                /* Initialization data        */
  2093.                  0L,                       /* Start immediately          */
  2094.                  4096);                    /* Stack size for thread      */
  2095.      break;
  2096.  
  2097.  
  2098. ΓòÉΓòÉΓòÉ 6.81. Starting a Child Process ΓòÉΓòÉΓòÉ
  2099.  
  2100. CHAR        szClient[7];                   /* ASCII form of win handle   */
  2101. CHAR        LoadError[100];                /* Buffer for failure reason  */
  2102. RESULTCODES ReturnInfo;                    /* Returned info from call    */
  2103. PID         pidServer;                     /* Child process id           */
  2104. APIRET      rc;                            /* Return code                */
  2105.   :
  2106.   :
  2107. itoa(hWnd, szClient);                      /* Convert handle to ASCII    */
  2108.  
  2109. rc = DosExecPgm(LoadError,                 /* Start child process        */
  2110.                 sizeof(LoadError),         /* Size of buffer             */
  2111.                 EXEC_ASYNCRESULT,          /* Execute asynchronously     */
  2112.                 szClient,                  /* Window handle in ASCII     */
  2113.                 0,                         /* No new environment vars    */
  2114.                 &ReturnInfo,               /* Returned info address      */
  2115.                 "server.exe");             /* Name of program to start   */
  2116.  
  2117. pidServer = ReturnCodes.termcodepid;
  2118.  
  2119. <Store pidServer in window words>
  2120.  
  2121. This example shows the use of the DosExecPgm() function to start a process from 
  2122. another process within the application. 
  2123.  
  2124.  
  2125. ΓòÉΓòÉΓòÉ 6.82. DosKillThread() Function ΓòÉΓòÉΓòÉ
  2126.  
  2127. <Retreive thread id from window words>
  2128.  
  2129. usReturn = DosKillThread(ThreadID);   /* Destroy secondary thread        */
  2130.  
  2131. This function allows the forced termination of a thread. 
  2132.  
  2133.  
  2134. ΓòÉΓòÉΓòÉ 6.83. Terminating a Process ΓòÉΓòÉΓòÉ
  2135.  
  2136. <Retrieve process id from window words>
  2137.  
  2138. rc = DosKillProcess(1,                     /* Kill only this process     */
  2139.                     pidServer);            /* Process ID to be killed    */
  2140.  
  2141. This example shows the use of the DosKillProcess() function to terminate a 
  2142. single process. 
  2143.  
  2144.  
  2145. ΓòÉΓòÉΓòÉ 6.84. Interprocess Communication Using Shared Memory (Part 1) ΓòÉΓòÉΓòÉ
  2146.  
  2147. REQUEST *Request;                               /* Request structure     */
  2148. REPLY   *Reply;                                 /* Reply structure ptr   */
  2149.   :
  2150. CASE WMP_SENDREQUEST:
  2151.      rc = DosAllocShrMem(&Request,              /* Allocate memory obj   */
  2152.                          NULL,                  /* Anonymous memory obj  */
  2153.                          sizeof(REQUEST),       /* Size of memory obj    */
  2154.                          OBJ_GIVEABLE,          /* Object is giveable    */
  2155.                          PAG_WRITE |            /* Allow write access    */
  2156.                          PAG_READ  |            /* Allow read access     */
  2157.                          PAG_COMMIT);           /* Commit storage now    */
  2158.      rc = DosGiveSharedMem(Request,             /* Give access to object */
  2159.                            pidServer,           /* Process to get access */
  2160.                            PAG_WRITE |          /* Write access allowed  */
  2161.                            PAG_READ);           /* Read access allowed   */
  2162.  
  2163.      rc = DosAllocShrMem(&Reply,                /* Allocate memory obj   */
  2164.                          NULL,                  /* Anonymous memory obj  */
  2165.                          sizeof(REPLY),         /* Size of memory obj    */
  2166.                          OBJ_GIVEABLE,          /* Object is giveable    */
  2167.                          PAG_WRITE |            /* Allow write access    */
  2168.                          PAG_READ  |            /* Allow read access     */
  2169.                          PAG_COMMIT);           /* Commit storage now    */
  2170.      rc = DosGiveSharedMem(Reply,               /* Give access to object */
  2171.                            pidServer,           /* Process to get access */
  2172.                            PAG_WRITE |          /* Write access allowed  */
  2173.                            PAG_READ);           /* Read access allowed   */
  2174.  
  2175.      Request->hRequester = hWnd;                /* Set requester handle  */
  2176.  
  2177.      <Initialize other Request structure fields>
  2178.  
  2179.      WinPostMsg(hServer,                        /* Post msg to server    */
  2180.                 WMP_DOREQUEST,                  /* DO_REQUEST message    */
  2181.                 (MPARAM)Request,                /* Ptr to request object */
  2182.                 (MPARAM)Reply);                 /* Ptr to reply object   */
  2183.  
  2184.      DosFreeMem(Request);                       /* Release request obj   */
  2185.      break;
  2186.        :
  2187. case WMP_REQUESTCOMPLETE:
  2188.      Reply=(PVOID)mp1;
  2189.  
  2190.      <Copy contents of Reply to private memory>
  2191.  
  2192.      DosFreeMem(Reply);                         /* Release reply object  */
  2193.      break;
  2194.  
  2195. This example shows a "requester" window procedure issuing requests and 
  2196. receiving replies by way of Presentation Manager messages. 
  2197.  
  2198.  
  2199. ΓòÉΓòÉΓòÉ 6.85. Interprocess Communication Using Shared Memory (Part 2) ΓòÉΓòÉΓòÉ
  2200.  
  2201. CASE WMP_DOREQUEST:
  2202.      Request = (REQUEST *)mp1;                  /* Get memory obj ptrs   */
  2203.      Reply = (REPLY *)mp2;
  2204.      DosGetSharedMem(&Request,                  /* Obtain access to obj  */
  2205.                      PAG_READ);                 /* Allow read access     */
  2206.      DosGetSharedMem(&Reply,                    /* Obtain access to obj  */
  2207.                      PAG_WRITE |                /* Allow write access    */
  2208.                      PAG_READ);                 /* Allow read access     */
  2209.  
  2210.      ServiceRequest(Request,Reply);             /* Complete request      */
  2211.  
  2212.      WinPostMsg(Request->hRequester,            /* Post msg to requester */
  2213.                 WMP_REQUESTCOMPLETE,            /* Message class         */
  2214.                 (MPARAM)Reply,                  /* Ptr to reply struct   */
  2215.                 (MPARAM)0);
  2216.  
  2217.      DosFreeMem(Request);                       /* Free request object   */
  2218.      DosFreeMem(Reply);                         /* Free reply object     */
  2219.      break;
  2220.  
  2221. This example shows a "server" window procedure receiving and processing 
  2222. Presentation Manager messages. 
  2223.  
  2224.  
  2225. ΓòÉΓòÉΓòÉ 6.86. Interprocess Communication Using Atoms (Part 1) ΓòÉΓòÉΓòÉ
  2226.  
  2227. CASE WMP_SENDREQUEST:
  2228.      hSysAtomTable = WinQuerySystemAtomTable(); /* Get atom table handle */
  2229.      ReqAtom = WinAddAtom(hSysAtomTable,        /* Add string to table   */
  2230.                           szRequest);           /* String to be added    */
  2231.      WinPostMsg(hServer,                        /* Post msg to server    */
  2232.                 WMP_DOREQUEST,                  /* DO_REQUEST message    */
  2233.                 (MPARAM)ReqAtom,                /* Atom to access string */
  2234.                 (MPARAM)hWnd);                  /* Return window handle  */
  2235.  
  2236.      <Store ReqAtom in window words>
  2237.  
  2238.      return((MRESULT)0);                        /* Return zero           */
  2239.      break;
  2240.        :
  2241.        :
  2242. case WMP_REQUESTCOMPLETE:
  2243.      hSysAtomTable = WinQuerySystemAtomTable(); /* Get atom table handle */
  2244.      ReplyAtom = (ATOM)mp1;                     /* Get atom for reply    */
  2245.      WinQueryAtomName(hSysAtomTable,            /* Get string from atom  */
  2246.                       ReplyAtom,                /* Atom                  */
  2247.                       szReply,                  /* Buffer for string     */
  2248.                       sizeof(szReply));         /* Size of buffer        */
  2249.  
  2250.      <Verify reply is correct>
  2251.  
  2252.      WinDeleteAtom(hSysAtomTable,               /* Delete atoms          */
  2253.                    ReqAtom);
  2254.      WinDeleteAtom(hSysAtomTable,
  2255.                    ReplyAtom);
  2256.      return(TRUE);
  2257.      break;
  2258.  
  2259. This example shows a "requester" window procedure issuing requests and 
  2260. receiving replies by way of Presentation Manager messages. 
  2261.  
  2262.  
  2263. ΓòÉΓòÉΓòÉ 6.87. Interprocess Communication Using Atoms (Part 2) ΓòÉΓòÉΓòÉ
  2264.  
  2265. CASE WMP_DOREQUEST:
  2266.      hAtomTable = WinQuerySystemAtomTable();    /* Get atom table handle */
  2267.      ReqAtom = (ATOM)mp1;                       /* Get atom for request  */
  2268.      hRequester = (HWND)mp2;                    /* Get requester handle  */
  2269.  
  2270.      ulLength = WinQueryAtomLength(hAtomTable,  /* Get size of string    */
  2271.                                    ReqAtom);
  2272.      szRequest = malloc(ulLength);              /* Allocate buffer       */
  2273.  
  2274.      WinQueryAtomName(hSysAtomTable,            /* Get string from atom  */
  2275.                       ReqAtom,                  /* Atom                  */
  2276.                       szRequest,                /* Buffer for string     */
  2277.                       sizeof(szRequest));       /* Size of buffer        */
  2278.  
  2279.      ServiceRequest(szRequest,szReply);         /* Complete request      */
  2280.  
  2281.      ReplyAtom = WinAddAtom(hSysAtomTable,      /* Add string to table   */
  2282.                             szReply);           /* String to be added    */
  2283.  
  2284.      WinPostMsg(hRequester,                     /* Post msg to requester */
  2285.                 WMP_REQUESTCOMPLETE,            /* Message class         */
  2286.                 (MPARAM)ReplyAtom,              /* Atom to access string */
  2287.                 (MPARAM)0);                     /* Return window handle  */
  2288.  
  2289.      free(szRequest);                           /* Free request buffer   */
  2290.      return((MRESULT)0);                        /* Return zero           */
  2291.      break;
  2292.  
  2293. This example shows a "server" window procedure receiving and processing 
  2294. Presentation Manager messages. 
  2295.  
  2296.  
  2297. ΓòÉΓòÉΓòÉ 6.88. Interprocess Communication Using Queues (Part 1) ΓòÉΓòÉΓòÉ
  2298.  
  2299. #define SRVQUEUENAME = "\\QUEUES\\SRV_QUEUE"    /* Server queue name     */
  2300. #define REQQUEUENAME = "\\QUEUES\\REQ_QUEUE"    /* Requester queue name  */
  2301.  
  2302. HQUEUE      hReqQueue, hSrvQueue;               /* Queue handles         */
  2303. REQUESTDATA Server;                             /* Control information   */
  2304. REQUEST     *Request;                           /* Request data buffer   */
  2305. REPLY       *Reply;                             /* Reply data buffer     */
  2306. BYTE        Priority;                           /* Priority information  */
  2307. ULONG       ulBytes;                            /* Bytes read/written    */
  2308. APIRET      rc;                                 /* Return code           */
  2309.  
  2310. case WMP_SENDREQUEST:
  2311.      rc = DosCreateQueue(&hReqQueue,            /* Create req queue      */
  2312.                          QUE_FIFO  |            /* First-in, first-out   */
  2313.                          QUE_CONVERT_ADDRESS,   /* Convert addresses     */
  2314.                          REQQUEUENAME);         /* Name of queue         */
  2315.  
  2316.      rc = DosOpenQueue(&pidServer,              /* Open srv queue        */
  2317.                        &hSrvQueue,              /* Queue handle          */
  2318.                        SRVQUEUENAME);           /* Server queue name     */
  2319.  
  2320.      rc = DosAllocSharedMem(&Request,           /* Allocate shared mem   */
  2321.                             NULL,               /* object for request    */
  2322.                             sizeof(REQUEST),    /* Size of memory object */
  2323.                             PAG_WRITE |         /* Allow write access    */
  2324.                             PAG_READ  |         /* Allow read access     */
  2325.                             PAG_COMMIT);        /* Commit storage now    */
  2326.      rc = DosGiveSharedMem(Request,             /* Give mem to server    */
  2327.                            pidServer,           /* Server process id     */
  2328.                            PAG_READ);           /* Allow read only       */
  2329.  
  2330.      rc = DosWriteQueue(hSrvQueue,              /* Add request to queue  */
  2331.                         (ULONG)hWnd,            /* Requester win handle  */
  2332.                         sizeof(REQUEST),        /* Size of request       */
  2333.                         Request,                /* Request buffer        */
  2334.                         0);                     /* No priority           */
  2335.      rc = DosCloseQueue(hSrvQueue);             /* Close srv queue       */
  2336.      DosFreeMem(Request);                       /* Free request buffer   */
  2337.      break;
  2338.  
  2339. This example shows elements being added to a queue by a "requester" process. 
  2340.  
  2341.  
  2342. ΓòÉΓòÉΓòÉ 6.89. Interprocess Communication Using Queues (Part 2) ΓòÉΓòÉΓòÉ
  2343.  
  2344. #define SRVQUEUENAME = "\\QUEUES\\SRV_QUEUE"    /* Server queue name     */
  2345. #define REQQUEUENAME = "\\QUEUES\\REQ_QUEUE"    /* Requester queue name  */
  2346.  
  2347. HQUEUE      hSrvQueue, hReqQueue;               /* Queue handles         */
  2348. REQUESTDATA Requester;                          /* Requester win handle  */
  2349. REQUEST     *Request;                           /* Request data buffer   */
  2350. REPLY       *Reply;                             /* Reply data buffer     */
  2351. BYTE        Priority;                           /* Element priority      */
  2352. ULONG       ulBytes;                            /* Bytes read/written    */
  2353. APIRET      rc;                                 /* Return code           */
  2354.  
  2355. rc = DosCreateQueue(&hSrvQueue,                 /* Create queue          */
  2356.                     QUE_FIFO  |                 /* First-in, first-out   */
  2357.                     QUE_CONVERT_ADDRESS,        /* Convert addresses     */
  2358.                     SRVQUEUENAME);              /* Name of queue         */
  2359. while (!ProcessEnded)                           /* Until process ends    */
  2360.       {
  2361.       rc = DosReadQueue(hSrvQueue,              /* Read queue            */
  2362.                         &Requester,             /* Control information   */
  2363.                         &ulBytes,               /* Bytes read            */
  2364.                         &Request,               /* Data buffer pointer   */
  2365.                         0,                      /* Get first element     */
  2366.                         DCWW_WAIT,              /* Wait synchronously    */
  2367.                         &Priority,              /* Priority of element   */
  2368.                         0);                     /* No event semaphore    */
  2369.  
  2370.       ServiceRequest(Request);                  /* Process request       */
  2371.  
  2372.       rc = DosOpenQueue(&Requester.idpid,       /* Open queue            */
  2373.                         &hReqQueue,             /* Queue handle          */
  2374.                         REQQUEUENAME);          /* Server queue name     */
  2375.       rc = DosAllocSharedMem(&Reply,            /* Allocate shared mem   */
  2376.                              NULL,              /* object for request    */
  2377.                              sizeof(REPLY),     /* Size of memory object */
  2378.                              PAG_WRITE |        /* Allow write access    */
  2379.                              PAG_READ  |        /* Allow read access     */
  2380.                              PAG_COMMIT);       /* Commit storage now    */
  2381.       rc = DosGiveSharedMem(Reply,              /* Give mem to requester */
  2382.                             &Requester.idpid,   /* Req process id        */
  2383.                             PAG_READ);          /* Allow read only       */
  2384.       rc = DosWriteQueue(hReqQueue,             /* Add request to queue  */
  2385.                          0L,                    /* No control info       */
  2386.                          sizeof(REPLY),         /* Size of reply         */
  2387.                          Reply,                 /* Reply buffer          */
  2388.                          0);                    /* No priority           */
  2389.       rc = DosCloseQueue(hReqQueue);            /* Close queue           */
  2390.  
  2391.       DosFreeMem(Request);                      /* Free request buffer   */
  2392.       WinPostMsg((HWND)Requester.ulData,        /* Post notification msg */
  2393.                  WMP_REQUESTCOMPLETE,           /* to requester window   */
  2394.                  (MPARAM)Reply,                 /* Reply buffer pointer  */
  2395.                  0);
  2396.       DosFreeMem(Reply);                        /* Free reply buffer     */
  2397.       }
  2398.  
  2399. This example shows the creation of a queue and the processing of items from the 
  2400. queue by a "server" process. 
  2401.  
  2402.  
  2403. ΓòÉΓòÉΓòÉ 6.90. Interprocess Communication Using Queues (Part 3) ΓòÉΓòÉΓòÉ
  2404.  
  2405. case WMP_REQUESTCOMPLETE:
  2406.      rc = DosReadQueue(hReqQueue,               /* Read req queue        */
  2407.                   &Server,                      /* Control information   */
  2408.                   &ulBytes,                     /* Bytes read            */
  2409.                   &Reply,                       /* Data buffer pointer   */
  2410.                   0,                            /* Get first element     */
  2411.                   DCWW_WAIT,                    /* Wait synchronously    */
  2412.                   &Priority,                    /* Priority of element   */
  2413.                   0);                           /* No event semaphore    */
  2414.  
  2415.      < Process reply>
  2416.  
  2417.      DosFreeMem(Reply);
  2418.      break;
  2419.  
  2420. This example shows returned data being read from a queue by a "requester" 
  2421. process. 
  2422.  
  2423.  
  2424. ΓòÉΓòÉΓòÉ 6.91. Interprocess Communication Using Named Pipes (Part 1) ΓòÉΓòÉΓòÉ
  2425.  
  2426. #define  NPIPE_NAME   "\\PIPE\\SRVPIPE"         /* Pipe name             */
  2427.  
  2428. void RequestThread(TRANS *Trans)                /* Requester thread      */
  2429. {
  2430.      ULONG      ulBytes;                        /* Bytes read/written    */
  2431.      APIRET     rc;                             /* Return code           */
  2432.  
  2433.      rc = DosWaitNPipe(NPIPE_NAME,              /* Wait on named pipe    */
  2434.                        NP_WAIT_INDEFINITELY);   /* Wait indefinitely     */
  2435.  
  2436.      rc = DosCallNPipe(NPIPE_NAME,              /* Pipe name             */
  2437.                        Trans->Request,          /* Request buffer ptr    */
  2438.                        sizeof(REQUEST),         /* Size of buffer        */
  2439.                        Trans->Reply,            /* Reply buffer ptr      */
  2440.                        sizeof(REPLY),           /* Size of buffer        */
  2441.                        &ulBytes,                /* No. of bytes read     */
  2442.                        10000);                  /* Timeout period        */
  2443.  
  2444.      WinPostMsg(Trans->hReturn,                 /* Notify calling window */
  2445.                 WMP_REQUESTCOMPLETE,            /* Request is complete   */
  2446.                 (MPARAM)Trans,                  /* Transaction structure */
  2447.                 0);
  2448.      DosExit(0);
  2449. }
  2450.  
  2451. This example shows a secondary thread in a "requester" process, writing to and 
  2452. reading from a named pipe. 
  2453.  
  2454.  
  2455. ΓòÉΓòÉΓòÉ 6.92. Interprocess Communication Using Named Pipes (Part 2) ΓòÉΓòÉΓòÉ
  2456.  
  2457. #define  NPIPE_NAME   "\\PIPE\\SRVPIPE"         /* Pipe name             */
  2458.  
  2459. HFILE      hPipe;                               /* Pipe handle           */
  2460. REQUEST    *Request;                            /* Request buffer        */
  2461. REPLY      *Reply;                              /* Reply buffer          */
  2462. ULONG      ulAction;                            /* Open action           */
  2463. ULONG      ulBytes;                             /* Bytes read/written    */
  2464. APIRET     rc;                                  /* Return code           */
  2465.  
  2466. rc = DosCreateNPipe(NPIPE_NAME,                 /* Create named pipe     */
  2467.                     &hPipe,                     /* Pipe handle           */
  2468.                     NP_ACCESS_DUPLEX,           /* Allow duplex access   */
  2469.                     NP_WAIT         |           /* Blocking mode         */
  2470.                     NP_TYPE_MESSAGE |           /* Msg oriented pipe     */
  2471.                     NP_READMODE_MESSAGE,        /* Msg oriented read     */
  2472.                     0x01,                       /* Single instance only  */
  2473.                     sizeof(REPLY),              /* Outbound buffer size  */
  2474.                     sizeof(REQUEST),            /* Inbound buffer size   */
  2475.                     0);                         /* Default timeout value */
  2476.  
  2477. while (!ProcessEnded)                           /* Until process ends    */
  2478.       {
  2479.       rc = DosConnectNPipe(hPipe);              /* Connect to requester  */
  2480.       rc = DosRead(hPipe,                       /* Read request          */
  2481.                    Request,                     /* Request buffer        */
  2482.                    sizeof(REQUEST),             /* Size of buffer        */
  2483.                    &ulBytes);                   /* No. of bytes read     */
  2484.  
  2485.       ServiceRequest(Request, Reply);           /* Complete request      */
  2486.  
  2487.       rc = DosWrite(hPipe,                      /* Write reply to pipe   */
  2488.                     Reply,                      /* Reply buffer          */
  2489.                     sizeof(REPLY),              /* Size of buffer        */
  2490.                     &ulBytes);                  /* No. of bytes written  */
  2491.       rc = DosDisConnectNPipe(hPipe);           /* Disconnect from req   */
  2492.       }
  2493.  
  2494. This example shows a "server" process creating and reading from a duplex named 
  2495. pipe. 
  2496.  
  2497.  
  2498. ΓòÉΓòÉΓòÉ 6.93. Synchronization Using Presentation Manager Messages ΓòÉΓòÉΓòÉ
  2499.  
  2500.         :
  2501. case WMP_THREAD:                        /* Start secondary thread       */
  2502.      DosCreateThread(ThreadID,          /* Thread ID                    */
  2503.                      Thread,            /* Entry point for thread       */
  2504.                      (PVOID)hwnd,       /* Invoking window handle       */
  2505.                      0L,                /* Start immediately            */
  2506.                      4096);             /* Stack size for thread        */
  2507.      break;
  2508.  
  2509. case WMP_ENDOFTHREAD:                   /* Thread has completed         */
  2510.  
  2511.      <perform end-of-thread processing>
  2512.  
  2513.      break;
  2514.         :
  2515.         :
  2516. int cdecl thread(hReturn)               /* Thread routine               */
  2517.     HWND hReturn;                       /* Handle of calling window     */
  2518. {
  2519.     <Perform lengthy processing task>
  2520.  
  2521.     WinPostMsg(hReturn,                 /* Post message to caller       */
  2522.                WMP_ENDOFTHREAD,         /* Message class                */
  2523.                0,0);                    /* No parameters                */
  2524.     DosExit(EXIT_THREAD,                /* Terminate thread             */
  2525.             0L);
  2526. }
  2527.  
  2528.  
  2529. ΓòÉΓòÉΓòÉ 6.94. Synchronization Using an Event Semaphore (Part 1) ΓòÉΓòÉΓòÉ
  2530.  
  2531. int cdecl thread()
  2532. {
  2533.     ulResult = DosCreateEventSem("\SEM32\THREAD", /* Name of semaphore  */
  2534.                                  hSem,            /* Semaphore handle   */
  2535.                                  NULL,            /* Not used           */
  2536.                                  FALSE);          /* Set immediately    */
  2537.  
  2538.     <Perform lengthy processing task>
  2539.  
  2540.     usResult = DosPostEventSem(hSem);             /* Release semaphore  */
  2541.     DosExit(0);                                   /* Terminate thread   */
  2542. }
  2543.  
  2544. This example shows the routine executing in the secondary thread. 
  2545.  
  2546.  
  2547. ΓòÉΓòÉΓòÉ 6.95. Synchronization Using an Event Semaphore (Part 2) ΓòÉΓòÉΓòÉ
  2548.  
  2549. case WMP_THREAD:
  2550.      usReturn = DosCreateThread(ThreadID,      /* Create thread          */
  2551.                                 Thread,        /* Entry point for thread */
  2552.                                 NULL,          /* No initialization data */
  2553.                                 0L,            /* Start immediately      */
  2554.                                 4096);         /* Stack size for thread  */
  2555.      WinStartTimer(hAB,                        /* Start timer            */
  2556.                    hwnd,                       /* Window to get WM_TIMER */
  2557.                    TID_THREAD,                 /* ID of timer            */
  2558.                    500);                       /* Period in milliseconds */
  2559.      break;
  2560.         :
  2561. case WM_TIMER:
  2562.      ulResult=DosOpenEventSem("\SEM32\THREAD", /* Get semaphore handle   */
  2563.                               hSem);           /* Semaphore handle       */
  2564.  
  2565.      ulResult=DosWaitEventSem(hSem,            /* Check semaphore state  */
  2566.                               0);              /* Immediate timeout      */
  2567.  
  2568.      if (ulResult!=ERROR_TIMEOUT)              /* Semaphore not set      */
  2569.         {
  2570.         <perform end-of-thread processing>     /* Thread has completed   */
  2571.         }
  2572.  
  2573.      ulResult=DosCloseEventSem(hSem);          /* Close semaphore        */
  2574.      break;
  2575.  
  2576. This example shows the window procedure in the primary thread, periodically 
  2577. testing to determine whether the event semaphore has been released. 
  2578.  
  2579.  
  2580. ΓòÉΓòÉΓòÉ 6.96. Synchronization Using the DosWaitThread() Function (Part 1) ΓòÉΓòÉΓòÉ
  2581.  
  2582. int cdecl thread()
  2583. {
  2584.     <Perform lengthy processing task>
  2585.  
  2586.     DosExit(EXIT_THREAD,                          /* Terminate thread   */
  2587.             0L);                                  /* Return code        */
  2588. }
  2589.  
  2590. This example shows the routine executing in the secondary thread. 
  2591.  
  2592.  
  2593. ΓòÉΓòÉΓòÉ 6.97. Synchronization Using the DosWaitThread() Function (Part 2) ΓòÉΓòÉΓòÉ
  2594.  
  2595. case WMP_THREAD:
  2596.      usReturn = DosCreateThread(ThreadID,      /* Create thread          */
  2597.                                 Thread,        /* Entry point for thread */
  2598.                                 NULL,          /* No initialization data */
  2599.                                 0L,            /* Start immediately      */
  2600.                                 4096);         /* Stack size for thread  */
  2601.  
  2602.      <Store ThreadID in instance data block>
  2603.  
  2604.      WinStartTimer(hAB,                        /* Start timer            */
  2605.                    hwnd,                       /* Window to get WM_TIMER */
  2606.                    TID_THREAD,                 /* ID of timer            */
  2607.                    50);                        /* Period in milliseconds */
  2608.      break;
  2609.         :
  2610. case WM_TIMER:
  2611.  
  2612.      <Get ThreadID from instance data block>
  2613.  
  2614.      ulReturn=DosWaitThread(ThreadID,           /* Check thread status   */
  2615.                             DCWW_NOWAIT);       /* Immediate timeout     */
  2616.      if (ulReturn==ERROR_THREAD_NOT_TERMINATED) /* Thread still running  */
  2617.         break;                                  /* Continue waiting      */
  2618.      else                                       /* else                  */
  2619.         <perform end-of-thread processing>      /* Thread has completed  */
  2620.      break;
  2621.  
  2622. This example shows the window procedure in the primary thread, periodically 
  2623. testing to determine whether the secondary thread has terminated. 
  2624.  
  2625.  
  2626. ΓòÉΓòÉΓòÉ 6.98. DosWaitChild() Function ΓòÉΓòÉΓòÉ
  2627.  
  2628. rc = DosWaitChild(DCWA_PROCESS,            /* Wait for this process only */
  2629.                   DCWW_WAIT,               /* Wait until termination     */
  2630.                   &ReturnInfo,             /* Returned info              */
  2631.                   &pidServer,              /* Returned process ID        */
  2632.                   pidServer);              /* Process id to wait on      */
  2633.  
  2634. This example assumes that the DosExecPgm() call shown in Figure "Starting a 
  2635. Child Process" has already been executed. 
  2636.  
  2637.  
  2638. ΓòÉΓòÉΓòÉ 6.99. Dynamically Inserting a Menu Bar Item ΓòÉΓòÉΓòÉ
  2639.  
  2640. hFrame = WinQueryWindow(hwnd,                 /* Current Window    */
  2641.                         QW_PARENT);           /* Parent            */
  2642.  
  2643. hMenu = WinWindowFromID(hFrame,               /* Get handle of     */
  2644.                         FID_MENU);            /* menu bar          */
  2645.  
  2646. MenuItem.iPosition = MIT_END;                 /* Item position     */
  2647. MenuItem.afStyle = MIS_TEXT;                  /* Item style        */
  2648. MenuItem.afAttribute = 0;                     /* No attributes     */
  2649. MenuItem.id = MI_OPENOBJECT;                  /* Item identifier   */
  2650. MenuItem.hItem = 0;                           /* No handle         */
  2651. MenuItem.hwndSubmenu = 0;                     /* No p'down handle  */
  2652.  
  2653. rc = WinSendDlgItemMsg(hMenu,                 /* Send message      */
  2654.                        MI_FILE,               /* to File pulldown  */
  2655.                        MM_INSERTITEM,         /* Message class     */
  2656.                        &MenuItem,             /* Pointer to item   */
  2657.                        szItemText);           /* Text of menu item */
  2658.  
  2659.  
  2660. ΓòÉΓòÉΓòÉ 6.100. Dynamically Inserting a Pulldown Menu ΓòÉΓòÉΓòÉ
  2661.  
  2662. HWND hPulldown;
  2663.   :
  2664. hPulldown = WinCreateMenu(hFrame,             /* Create empty menu */
  2665.                           NULL);              /* template          */
  2666.  
  2667. MenuItem.iPosition = MIT_END;                 /* Item position     */
  2668. MenuItem.afStyle = MIS_TEXT;                  /* Item style        */
  2669. MenuItem.afAttribute = 0;                     /* No attributes     */
  2670. MenuItem.id = MN_OPENOBJECT;                  /* Item identifier   */
  2671. MenuItem.hItem = 0;                           /* No handle         */
  2672. MenuItem.hwndSubmenu = hPulldown;             /* No p'down handle  */
  2673.  
  2674. rc = WinSendDlgItemMsg(hMenu,                 /* Send message      */
  2675.                        MN_FILE,               /* to File pulldown  */
  2676.                        MM_INSERTITEM,         /* Message class     */
  2677.                        &MenuItem,             /* Pointer to item   */
  2678.                        szItemText);           /* Text of menu item */
  2679.  
  2680.  
  2681. ΓòÉΓòÉΓòÉ 6.101. Disabling an Menu Bar/Pulldown Menu Item ΓòÉΓòÉΓòÉ
  2682.  
  2683. hMenu = WinWindowFromID(hFrame,            /* Get menu bar handle        */
  2684.                       FID_MENU);
  2685.  
  2686. rc = WinEnableMenuItem(hMenu,              /* Menu bar handle            */
  2687.                        MI_VIEW,            /* Menu item identifier       */
  2688.                        TRUE);              /* Enable menu item           */
  2689.  
  2690.  
  2691. ΓòÉΓòÉΓòÉ 6.102. Placing a Check Mark on a Pulldown Menu Item ΓòÉΓòÉΓòÉ
  2692.  
  2693. hMenu = WinWindowFromID(hFrame,            /* Get menu bar handle        */
  2694.                          FID_MENU);
  2695.  
  2696. rc = WinCheckMenuItem(hMenu,               /* Menu bar handle            */
  2697.                       MI_OPTION1,          /* Menu item identifier       */
  2698.                       TRUE);               /* Set check mark             */
  2699.  
  2700.  
  2701. ΓòÉΓòÉΓòÉ 6.103. Standard Dialogs - WinFileDlg() Function ΓòÉΓòÉΓòÉ
  2702.  
  2703. USHORT OpenFile(HWND hOwner)
  2704. {
  2705.    extern PFNWP    WinFileDlg();          /* Function prototype          */
  2706.    extern FILEDLG  fild;                  /* File dlg control structure  */
  2707.    extern HFILE    hFileToOpen;           /* File handle                 */
  2708.    extern USHORT   usAction;              /* Action indicator            */
  2709.    static BOOL     fFirstTime = TRUE;     /* Flag                        */
  2710.    USHORT usReturn;                       /* Return code                 */
  2711.  
  2712.    if (fFirstTime)                        /* If invoked for first time   */
  2713.       {                                   /* build control structure     */
  2714.       fild.cbSize = sizeof(FILEDLG);      /* Set size of control struct  */
  2715.       fild.fl     = FDS_OPEN_DIALOG |     /* Set dialog type to "Open"   */
  2716.                     FDS_CENTER      |     /* Centered in parent window   */
  2717.                     FDS_HELP_BUTTON;      /* Include help button         */
  2718.       fild.pszTitle       = NULL;         /* Use default title bar text  */
  2719.       fild.pszOKButton    = NULL;         /* Use default button text     */
  2720.       fild.pfnDlgProc     = NULL;         /* Use standard dlg proc       */
  2721.       fild.hmod           = NULL;         /*  "     "      "    "        */
  2722.       fild.idDlg          = 0;            /*  "     "      "    "        */
  2723.       fild.pszIType       = NULL;         /* No initial type setting     */
  2724.       fild.ppszITypeList  = NULL;         /* No list of types            */
  2725.       fild.pszIDrive      = NULL;         /* No initial drive setting    */
  2726.       fild.ppszIDriveList = NULL;         /* No list of drivers          */
  2727.       fFirstTime = FALSE;                 /* Set flag to false           */
  2728.       }
  2729.    WinFileDlg(hOwner,                     /* Invoke file dialog          */
  2730.               &fild);                     /* Control structure pointer   */
  2731.  
  2732.    rc = DosOpen(fild.szFullFile,          /* Open returned file name     */
  2733.                 &hFileToOpen,             /* File handle                 */
  2734.                 &usAction,                /* Action indicator            */
  2735.                 0L,                       /* File size not applicable    */
  2736.                 0,                        /* File attribute ignored      */
  2737.                 0x0001,                   /* Open file if it exists      */
  2738.                 0x00C2,                   /* Non-shared, read-write      */
  2739.                 0L);                      /* No sharing mode             */
  2740.    return(rc);                            /* Return                      */
  2741. }
  2742.  
  2743.  
  2744. ΓòÉΓòÉΓòÉ 6.104. WinFontDlg() Function - Sample Code ΓòÉΓòÉΓòÉ
  2745.  
  2746. void SetFont(HWND hOwner, HPS hpsScreen, USHORT usCodePage)
  2747. {
  2748.      extern PFNWP   WinFontDlg();             /* Function prototype      */
  2749.      extern FONTDLG fntd;                     /* Dialog control struct   */
  2750.      static BOOL    fFirstTime = TRUE;        /* Flag                    */
  2751.      CHARBUNDLE     cbnd;                     /* Attributes              */
  2752.  
  2753. if (FirstTime)                                /* If invoked for 1st time */
  2754.    {                                          /* build control structure */
  2755.    fntd.cbSize            = sizeof(FONTDLG);  /* Set size of structure   */
  2756.    fntd.fl                = FNTS_CENTER |     /* Specify centered dlg    */
  2757.                             FNTS_HELPBUTTON;  /* Include help button     */
  2758.    fntd.hpsPrinter        = NULL;             /* No printer font         */
  2759.    fntd.pszTitle          = "Fonts";          /* Dialog title text       */
  2760.    fntd.pfnDlgProc        = NULL;             /* Use standard dlg proc   */
  2761.    fntd.hmod              = NULL;             /*  "     "      "    "    */
  2762.    fntd.idDlg             = 0;                /*  "     "      "    "    */
  2763.    fntd.pszPreview        = NULL              /* Default preview string  */
  2764.    fntd.pszPtSizeList     = NULL;             /* Default point sizes     */
  2765.    fntd.flFlags           = 0L;               /* Default flags           */
  2766.    fntd.szFamilyname[]    = '\0';             /* System default          */
  2767.    fntd.fxPointSize       = MAKEFIXED(12,0);  /* 12-point vertical size  */
  2768.    fntd.usWeight          = FWEIGHT_NORMAL;   /* Weight or thickness     */
  2769.    fntd.usWidth           = FWIDTH_NORMAL;    /* Character width         */
  2770.    fntd.flType            = 0L;               /* No additional attribs   */
  2771.    fntd.flStyle           = 0L;               /* No additional styles    */
  2772.    fntd.flCHSOptions      = 0L;               /* No additional options   */
  2773.    fntd.clrFore           = CLR_BLACK;        /* Black characters        */
  2774.    fntd.clrBack           = CLR_WHITE;        /* White background        */
  2775.    fntd.fAttrs.usCodePage = usCodePage;       /* Specified code page     */
  2776.    fFirstTime=FALSE;                          /* Reset flag              */
  2777.    }
  2778. fntd.hpsScreen=hpsScreen;                     /* Set presentation space  */
  2779.  
  2780. WinFontDlg(hOwner,                            /* Invoke font dialog      */
  2781.            &fntd);                            /* Control structure ptr   */
  2782.  
  2783. GpiCreateLogFront(hpsScreen,                  /* Create logical font     */
  2784.                   "Name    ",                 /* Name of font            */
  2785.                   0,                          /* Local font identifier   */
  2786.                   fntd.fAttrs);               /* Returned attributes     */
  2787. cbnd.lColor = fntd.clrFore;                   /* Set foreground color    */
  2788. cbnd.lBackColor = fntd.clrBack;               /* Set background color    */
  2789. GpiSetAttrs(hpsScreen,                        /* Set attributes          */
  2790.             PRIM_CHAR,                        /* Character attributes    */
  2791.             CBB_COLOR | CBB_BACK_COLOR,       /* Attributes to be set    */
  2792.             0L,                               /* Defaults mask           */
  2793.             (PBUNDLE)&cbnd);                  /* Attribute structure     */
  2794. GpiCharStringPos(hpsScreen,                   /* Write character string  */
  2795.                  NULL,                        /* No rectangle            */
  2796.                  fntd.flCHSOptions,           /* Options                 */
  2797.                  4,                           /* Number of bytes         */
  2798.                  "Text",                      /* Text string             */
  2799.                  NULL);                       /* Increment values        */
  2800. }
  2801.  
  2802.  
  2803. ΓòÉΓòÉΓòÉ 6.105. DosCreateThread() Function ΓòÉΓòÉΓòÉ
  2804.  
  2805. APIRET    rc;                            /* Return code                  */
  2806. PTID      ThreadID;                      /* Thread identifier            */
  2807. MYSTRUCT  *ParmBlock;                    /* Initialization data          */
  2808.  
  2809. rc = DosCreateThread(ThreadID,           /* Create thread                */
  2810.                      Thread,             /* Entry point for thread       */
  2811.                      ParmBlock,          /* Parameters for thread        */
  2812.                      0L,                 /* Start immediately            */
  2813.                      8192);              /* Stack size for thread        */
  2814.  
  2815. This example shows the enhanced form of this function as implemented under OS/2 
  2816. Version 2.0. 
  2817.  
  2818.  
  2819. ΓòÉΓòÉΓòÉ 6.106. DosAllocMem() Function ΓòÉΓòÉΓòÉ
  2820.  
  2821. APIRET    rc;                          /* Return code                    */
  2822. PVOID     pObject;                     /* Pointer to memory object       */
  2823.  
  2824. rc = DosAllocMem(&pObject,             /* Allocate memory object         */
  2825.                  73727,                /* Size of memory object          */
  2826.                  PAG_COMMIT |          /* Commit memory immediately      */
  2827.                  PAG_READ   |          /* Allow read access              */
  2828.                  PAG_WRITE);           /* Allow write access             */
  2829.  
  2830. This function replaces the DosAllocSeg() function implemented in previous 
  2831. versions of OS/2. 
  2832.  
  2833.  
  2834. ΓòÉΓòÉΓòÉ 6.107. Declaring a 16-Bit Function in 32-Bit Code ΓòÉΓòÉΓòÉ
  2835.  
  2836. #pragma stack16(8192)
  2837.  
  2838. USHORT MyFunction(USHORT FirstNum, HWND _Seg16 hWnd);
  2839.  
  2840. #pragma linkage (MyFunction, far16 pascal)
  2841.  
  2842.  
  2843. ΓòÉΓòÉΓòÉ 6.108. Creating a 16-bit Window From Within a 32-bit Module ΓòÉΓòÉΓòÉ
  2844.  
  2845. 32-bit Module
  2846.  
  2847. #pragma stack16(8192)
  2848.  
  2849. HWND MakeMyWindow(void);                   /* 16-bit function prototype  */
  2850. #pragma linkage (MakeMyWindow, far16 pascal)
  2851.  
  2852. HWND _Seg16 hWindow;                       /* 16:16 window handle        */
  2853.   :
  2854.   :
  2855. hWindow = MakeMyWindow();                  /* Call registration routine  */
  2856.  
  2857. 16-bit Module
  2858.  
  2859. HWND EXPENTRY MakeMyWindow(void)           /* Registration routine       */
  2860. {
  2861.      HWND hCurrWindow;                     /* 16:16 window handle        */
  2862.  
  2863.      WinRegisterClass(...);                /* Register window class      */
  2864.      hCurrWindow = WinCreateWindow(...);   /* Create window              */
  2865.  
  2866.      return(hCurrWindow);                  /* Return 16:16 window handle */
  2867. }
  2868.  
  2869.  
  2870. ΓòÉΓòÉΓòÉ 6.109. Passing a 16:16 Pointer as a Message Parameter ΓòÉΓòÉΓòÉ
  2871.  
  2872. typedef struct mystruct {                  /* Define data structure      */
  2873.                         CHAR * _Seg16 Name;
  2874.                         ULONG         ulA;
  2875.                         ULONG         ulB;
  2876.                         USHORT        usC;
  2877.                         } MYSTRUCT;
  2878.  
  2879. pragma seg16(MYSTRUCT)                     /* Define pragma directive    */
  2880.  
  2881. MYSTRUCT * _Seg16 MyStruct;                /* 16:16 pointer              */
  2882.  
  2883. APIRET   rc;                               /* Return code                */
  2884.  
  2885. MPARAM   mp1;                              /* Message parameter          */
  2886.  
  2887. rc = DosAllocMem(&MyStruct,                /* Allocate data structure    */
  2888.                  4096,                     /* Size of data structure     */
  2889.                  PAG_READ  |               /* Allow read access          */
  2890.                  PAG_WRITE |               /* Allow write access         */
  2891.                  PAG_COMMIT);              /* Commit storage immediately */
  2892.  
  2893. <Initialize structure if required>
  2894.  
  2895. mp1 = MPFROMP(MyStruct);                   /* Set message parameter      */
  2896.  
  2897. This example shows the 32-bit code necessary to define and initialize a 16:16 
  2898. pointer to be passed to a 16-bit window procedure. 
  2899.  
  2900.  
  2901. ΓòÉΓòÉΓòÉ 6.110. Mixed Model Programming - WinSetWindowThunkProc() Function ΓòÉΓòÉΓòÉ
  2902.  
  2903. WinSetWindowThunkProc(hWindow,               /* Window handle            */
  2904.                       (PFN)ThunkProc16to32); /* Thunk proc entry point   */
  2905.  
  2906.  
  2907. ΓòÉΓòÉΓòÉ 6.111. Mixed Model Programming - Thunk Procedure ΓòÉΓòÉΓòÉ
  2908.  
  2909. MRESULT EXPENTRY ThunkProc16to32(HWND hwnd,       /* Window handle       */
  2910.                                  ULONG ulMsg,     /* Message identifier  */
  2911.                                  MPARAM mp1,      /* Message parameters  */
  2912.                                  MPARAM mp2,
  2913.                                  PFNWP wpWindow); /* Window procedure    */
  2914. {
  2915.         switch (ulMsg)
  2916.                {
  2917.                case WMP_MSG1:
  2918.                     mp1=DosSeltoFlat(mp1);        /* Thunk parameters    */
  2919.                     mp2=DosSeltoFlat(mp2);
  2920.                     break;
  2921.                case WMP_MSG2:
  2922.                     mp1=DosSeltoFlat(mp1);        /* Thunk 1st parameter */
  2923.                     break;
  2924.                }
  2925.         return((*wpWindow)(hwnd,                  /* Call window proc    */
  2926.                            ulMsg,
  2927.                            mp1,
  2928.                            mp2));
  2929. }
  2930.  
  2931.  
  2932. ΓòÉΓòÉΓòÉ 6.112. 16:16 to 0:32 Address Conversion ΓòÉΓòÉΓòÉ
  2933.  
  2934. PVOID CRMA16to32(PVOID pPointer)                  /* Perform conversion  */
  2935. {
  2936.       USHORT usTemp;                              /* Temporary variable  */
  2937.  
  2938.       if (pPointer)                               /* If not NULL         */
  2939.          {
  2940.          usTemp=HIUSHORT(pPointer) >> 3;          /* Shift right 3 bits  */
  2941.          return(MAKEP(uTemp,                      /* Swap hi & lo words  */
  2942.                       LOUSHORT(pPointer)));
  2943.          }
  2944.       else
  2945.          return(NULL);
  2946. }
  2947.  
  2948.  
  2949. ΓòÉΓòÉΓòÉ 6.113. Development Process for New WPS Classes ΓòÉΓòÉΓòÉ
  2950.  
  2951.  
  2952. ΓòÉΓòÉΓòÉ 6.114. Compiling and Linking an OS/2 Presentation Manager Application ΓòÉΓòÉΓòÉ
  2953.  
  2954.  
  2955. ΓòÉΓòÉΓòÉ 6.115. Sample Module Definition File for Presentation Manager ΓòÉΓòÉΓòÉ
  2956.  
  2957. ; Sample Presentation Manager Module Definition File
  2958.  
  2959. NAME              MYPROG   WINDOWAPI
  2960. DESCRIPTION       'Sample PM Application (C) IBM Corporation 1991'
  2961. PROTMODE
  2962.  
  2963. STUB              'OS2STUB.EXE'
  2964.  
  2965. STACKSIZE         8192
  2966. HEAPSIZE          1024
  2967.  
  2968. EXPORTS           ThisWindowProc
  2969.                   ThatWindowProc
  2970.                   TheOtherWindowProc
  2971.  
  2972.  
  2973. ΓòÉΓòÉΓòÉ 6.116. Sample Module Definition File to Create a DLL ΓòÉΓòÉΓòÉ
  2974.  
  2975. ; Sample PM Module Definition File for Creating a DLL
  2976.  
  2977. LIBRARY           MYDLL INITINSTANCE TERMINSTANCE
  2978. DESCRIPTION       'Sample PM Dynamic Link Library (c) IBM 1991'
  2979. PROTMODE
  2980. DATA              MULTIPLE
  2981.  
  2982. EXPORTS           RoutineNumberOne
  2983.                   RoutineNumberTwo
  2984.                   RoutineNumberThree
  2985.  
  2986.  
  2987. ΓòÉΓòÉΓòÉ 6.117. IPF Tag Language Example ΓòÉΓòÉΓòÉ
  2988.  
  2989. :h1.Adding Online Help and Documentation
  2990. :p.In line with the philosophy of making applications easy to use
  2991. through the provision of an intuitive, graphical user interface,
  2992. it is extremely useful to have an application provide online,
  2993. context-sensitive help and tutorial facilities to the end user.
  2994. Such...
  2995.  
  2996.  
  2997. ΓòÉΓòÉΓòÉ 6.118. Simple Help Panel Source ΓòÉΓòÉΓòÉ
  2998.  
  2999. :h2 res=12345 x=left y=bottom cx=50% cy=25%.Help Window Heading
  3000. :p.The sequence of operations you have performed was never
  3001. envisaged by the person who wrote this program, and no help
  3002. information has been written into these panels to deal with
  3003. this contingency. You are therefore totally beyond help.
  3004. Exciting, isn't it?
  3005.  
  3006.  
  3007. ΓòÉΓòÉΓòÉ 6.119. Displaying a Bitmap in a Help Window ΓòÉΓòÉΓòÉ
  3008.  
  3009. :h2 res=223.Bitmap Help Example
  3010. :p.This example shows how to display a bitmap in a help window
  3011. using the :artwork tag.
  3012. :artwork name='BITMAP.BMP' align=left.
  3013.  
  3014.  
  3015. ΓòÉΓòÉΓòÉ 6.120. Hypertext Link ΓòÉΓòÉΓòÉ
  3016.  
  3017. :h2 res=004.Hypertext Example
  3018. :p.This example shows the use of a
  3019. :link reftype=hd res=1013.hypertext link:elink.
  3020. to display another help window when the user selects the
  3021. hypertext item.
  3022.  
  3023.  
  3024. ΓòÉΓòÉΓòÉ 6.121. Hypergraphic Link ΓòÉΓòÉΓòÉ
  3025.  
  3026. :h2 res=0005.Hypergraphic Example
  3027. :p.This example shows how to define hypergraphic links in a
  3028. bitmap.
  3029. :p.The first item shows a single hypergraphic link.
  3030. :artwork name='BITMAP.BMP' align=left.
  3031. :artlink.
  3032. :link reftype=hd res=0107.
  3033. :eartlink.
  3034. :p.The next item shows multiple hypergraphic links in the same
  3035. bitmap.
  3036. :artwork name='BITMAP2.BMP' align=center linkfile='BMP2'.
  3037.  
  3038.  
  3039. ΓòÉΓòÉΓòÉ 6.122. Link File With Multiple Hypergraphic Links ΓòÉΓòÉΓòÉ
  3040.  
  3041. :artlink.
  3042. :link reftype=hd res=0110 x=0 y=0 cx=30 cy=20.
  3043. :link reftype=hd res=0111 x=31 y=21 cx=30 cy=20.
  3044. :link reftype=launch object='C:\APPLS\APPL1.EXE'
  3045.       x=61 y=41 cx=20 cy=10.
  3046. :eartlink.
  3047.  
  3048.  
  3049. ΓòÉΓòÉΓòÉ 6.123. Multiple Viewports Using Automatic Links ΓòÉΓòÉΓòÉ
  3050.  
  3051. :h2 res=0120
  3052.       x=center y=center width=50% height=50%.
  3053.       Multiple Viewports Example
  3054. :link reftype=hd res=0121
  3055.       auto dependent
  3056.       vpx=left vpy=bottom vpcx=50% vpcy=100%
  3057.       scroll=none titlebar=none rules=none.
  3058. :link reftype=hd res=0122
  3059.       auto dependent
  3060.       vpx=right vpy=bottom vpcx=50% vpcy=100%
  3061.       scroll=vertical titlebar=none rules=none.
  3062.  
  3063.  
  3064. ΓòÉΓòÉΓòÉ 6.124. Application-Controlled Viewport ΓòÉΓòÉΓòÉ
  3065.  
  3066. :h1 res=0101
  3067.       x=center y=center width=50% height=50%.
  3068.       scroll=none.Application-Controlled Viewport Example
  3069. :acviewport dll='SAMPLES' objectname='flight' objectid=1
  3070.       vpx=left vpy=bottom vpcx=50% vpcy=50%.
  3071.  
  3072.  
  3073. ΓòÉΓòÉΓòÉ 6.125. Help Table Resource Definition ΓòÉΓòÉΓòÉ
  3074.  
  3075. HELPTABLE MAINHELP
  3076. BEGIN
  3077.      HELPITEM MAIN,    SUBTABLE_MAIN,    EXTHELP_MAIN
  3078.      HELPITEM DIALOG1, SUBTABLE_DIALOG1, EXTHELP_DIALOG1
  3079. END
  3080.  
  3081. HELPSUBTABLE SUBTABLE_MAIN
  3082. BEGIN
  3083.      HELPSUBITEM MI_FILE, 0010
  3084.      HELPSUBITEM MI_EDIT, 0020
  3085.      HELPSUBITEM MI_VIEW, 0030
  3086.      HELPSUBITEM MI_EXIT, 0040
  3087. END
  3088.  
  3089. HELPSUBTABLE SUBTABLE_DIALOG1
  3090. BEGIN
  3091.      HELPSUBITEM EF_ITEM1, 0101
  3092.      HELPSUBITEM EF_ITEM2, 0102
  3093.      HELPSUBITEM CK_ITEM3, 0103
  3094.      HELPSUBITEM PB_ITEM4, 0104
  3095.      HELPSUBITEM PB_ITEM5, 0105
  3096. END
  3097.  
  3098.  
  3099. ΓòÉΓòÉΓòÉ 6.126. WinCreateHelpInstance() Function ΓòÉΓòÉΓòÉ
  3100.  
  3101. PHELPINIT HelpInit;
  3102. HWND      hHelp;
  3103.  
  3104. HelpInit=DosAllocMem(HelpInit,                /* Allocate memory object  */
  3105.                      sizeof(HELPINIT),        /* Size of HELPINIT struct */
  3106.                      PAG_READ   |             /* Allow read access       */
  3107.                      PAG_WRITE  |             /* Allow write access      */
  3108.                      PAG_COMMIT;              /* Commit storage now      */
  3109.  
  3110. HelpInit->cb=sizeof(HELPINIT);                /* Specify size of struct  */
  3111. HelpInit->pszTutorialName=NULL;               /* No tutorial             */
  3112. HelpInit->phtHelpTable=MAINHELP;              /* Help table identifier   */
  3113. HelpInit->phtHelpTableModule=NULL;            /* Help table in EXE file  */
  3114. HelpInit->hmodAccelActionBarModule=NULL;      /* Resource in EXE file    */
  3115. HelpInit->idAccelTable=0;                     /* Resource in EXE file    */
  3116. HelpInit->idActionBar=0;                      /* Default used            */
  3117. HelpInit->pszHelpWindowTitle="Help";          /* Help window title       */
  3118. HelpInit->usShowPanelID=CMIC_HIDE_PANEL_ID;   /* Do not show panel ids   */
  3119. HelpInit->pszHelpLibraryName="APPLHELP";      /* Name of help library    */
  3120.  
  3121. hHelp = WinCreateHelpInstance(hAB,            /* Create help instance    */
  3122.                               HelpInit);      /* HELPINIT structure      */
  3123.  
  3124.  
  3125. ΓòÉΓòÉΓòÉ 6.127. WinAssociateHelpInstance() Function ΓòÉΓòÉΓòÉ
  3126.  
  3127. rc = WinAssociateHelpInstance(hHelp,          /* Help instance handle    */
  3128.                               hFrame);        /* Frame window handle     */
  3129.  
  3130.  
  3131. ΓòÉΓòÉΓòÉ 6.128. WinDestroyHelpInstance() Function ΓòÉΓòÉΓòÉ
  3132.  
  3133. rc = WinDestroyHelpInstance(hHelp);           /* Destroy help instance   */
  3134.  
  3135.  
  3136. ΓòÉΓòÉΓòÉ 6.129. Help Pulldown Menu Definition ΓòÉΓòÉΓòÉ
  3137.  
  3138.    :
  3139.    :
  3140. SUBMENU     "~Help",             ID_HELP
  3141. BEGIN
  3142.    MENUITEM "~Help for help...", ID_HELP_FOR_HELP
  3143.    MENUITEM "~Extended help...", SC_HELPEXTENDED, MIS_SYSCOMMAND
  3144.    MENUITEM "~Keys help...",     SC_HELPKEYS, MIS_SYSCOMMAND
  3145.    MENUITEM "Help ~index...",    SC_HELPINDEX, MIS_SYSCOMMAND
  3146. END
  3147.    :
  3148.    :
  3149.  
  3150. This example shows the "Help" pulldown menu included in the menu bar of the 
  3151. default main help window used by IPF. 
  3152.  
  3153.  
  3154. ΓòÉΓòÉΓòÉ 6.130. Network Domains ΓòÉΓòÉΓòÉ
  3155.  
  3156.  
  3157. ΓòÉΓòÉΓòÉ 6.131. Production Libraries on a LAN Server ΓòÉΓòÉΓòÉ
  3158.  
  3159.    Server Root Directory ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇ Compilers and link-editors
  3160.                            Γöé
  3161.                            Γö£ΓöÇΓöÇΓöÇ Application source code
  3162.                            Γöé
  3163.                            Γö£ΓöÇΓöÇΓöÇ Application include files
  3164.                            Γöé
  3165.                            Γö£ΓöÇΓöÇΓöÇ Presentation Manager resources
  3166.                            Γöé
  3167.                            Γö£ΓöÇΓöÇΓöÇ Installation code libraries
  3168.                            Γöé
  3169.                            ΓööΓöÇΓöÇΓöÇ Test data
  3170.  
  3171.  
  3172. ΓòÉΓòÉΓòÉ 7. Tables ΓòÉΓòÉΓòÉ
  3173.  
  3174.  Window Identifiers 
  3175.  Application Object/Window Correlation 
  3176.  Presentation Manager Macros 
  3177.  New Presentation Manager Functions in OS/2 Version 2.0 
  3178.  Type Prefixes for Symbolic Constants 
  3179.  Type Prefixes for Variables 
  3180.  Type Prefixes for Pointers 
  3181.  Memory Management Functions 
  3182.  Session Management Functions 
  3183.  Task Management Functions 
  3184.  Exception Handling Functions 
  3185.  Anonymous Pipe Functions 
  3186.  Named Pipe Functions 
  3187.  Queue Functions 
  3188.  Semaphore Functions 
  3189.  Message Retrieval Functions 
  3190.  Timer Services Functions 
  3191.  Dynamic Linking Functions 
  3192.  Device I/O Functions 
  3193.  File I/O Functions 
  3194.  Code Page Functions 
  3195.  Error Management Functions 
  3196.  
  3197.  
  3198. ΓòÉΓòÉΓòÉ 7.1. Window Identifiers ΓòÉΓòÉΓòÉ
  3199.  
  3200.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3201.  Γöé Window Identifiers.  This table shows the window identifiers           Γöé
  3202.  Γöé assigned by Presentation Manager to the children of a frame window.    Γöé
  3203.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3204.  Γöé CHILD WINDOW            Γöé WINDOW IDENTIFIER   Γöé DEFINED BY             Γöé
  3205.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3206.  Γöé Client Window           Γöé FID_CLIENT          Γöé Application            Γöé
  3207.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3208.  Γöé System Menu             Γöé FID_SYSMENU         Γöé Presentation Manager   Γöé
  3209.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3210.  Γöé Menu Bar                Γöé FID_MENU            Γöé Presentation Manager   Γöé
  3211.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3212.  Γöé Title Bar               Γöé FID_TITLEBAR        Γöé Presentation Manager   Γöé
  3213.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3214.  Γöé Min/Max Icon            Γöé FID_MINMAX          Γöé Presentation Manager   Γöé
  3215.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3216.  Γöé Vertical Scroll Bar     Γöé FID_VERTSCROLL      Γöé Presentation Manager   Γöé
  3217.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3218.  Γöé Horizontal Scroll Bar   Γöé FID_HORZSCROLL      Γöé Presentation Manager   Γöé
  3219.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3220.  Γöé NOTE:  The "Defined by" column indicates whether the window procedure  Γöé
  3221.  Γöé that determines a window's appearance and behavior is supplied by      Γöé
  3222.  Γöé supplied by Presentation Manager or the application.                   Γöé
  3223.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3224.  
  3225.  
  3226. ΓòÉΓòÉΓòÉ 7.2. Application Object/Window Correlation ΓòÉΓòÉΓòÉ
  3227.  
  3228.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3229.  Γöé Application Object/Window Correlation                        Γöé
  3230.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3231.  Γöé APPLICATION OBJECT    Γöé SUPPORTED Γöé IMPLEMENTATION           Γöé
  3232.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3233.  Γöé Message Communication Γöé Yes       Γöé PM Message               Γöé
  3234.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3235.  Γöé Class Association     Γöé Yes       Γöé Window Class             Γöé
  3236.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3237.  Γöé Class Data            Γöé Yes       Γöé Defined in Window Proce- Γöé
  3238.  Γöé                       Γöé           Γöé dure                     Γöé
  3239.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3240.  Γöé Instance Data         Γöé Yes       Γöé Stored in Window Words   Γöé
  3241.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3242.  Γöé Encapsulation         Γöé Yes       Γöé In Window Procedure      Γöé
  3243.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3244.  Γöé Polymorphism          Γöé Yes       Γöé In Window Procedure      Γöé
  3245.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3246.  Γöé Inheritance           Γöé Partial   Γöé Via Subclassing          Γöé
  3247.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3248.  
  3249.  
  3250. ΓòÉΓòÉΓòÉ 7.3. Presentation Manager Macros ΓòÉΓòÉΓòÉ
  3251.  
  3252. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3253. Γöé Presentation Manager Macros.  This table shows the "C" language macros  Γöé
  3254. Γöé provided by Presentation Manager to facilitate the construction and     Γöé
  3255. Γöé extraction of message parameters.                                       Γöé
  3256. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3257. Γöé MACRO        Γöé USAGE                                                    Γöé
  3258. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3259. Γöé MPFROMP      Γöé Produces an MPARAM data type from a pointer              Γöé
  3260. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3261. Γöé MPFROMHWND   Γöé Produces an MPARAM data type from a window handle (HWND) Γöé
  3262. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3263. Γöé MPFROMCHAR   Γöé Produces an MPARAM data type from an unsigned character  Γöé
  3264. Γöé              Γöé (UCHAR)                                                  Γöé
  3265. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3266. Γöé MPFROMSHORT  Γöé Produces an MPARAM data type from a short integer        Γöé
  3267. Γöé              Γöé (SHORT or USHORT)                                        Γöé
  3268. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3269. Γöé MPFROM2SHORT Γöé Produces an MPARAM data type from two short integers     Γöé
  3270. Γöé              Γöé (SHORT or USHORT)                                        Γöé
  3271. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3272. Γöé MPFROMSH2CH  Γöé Produces an MPARAM data type from a short integer        Γöé
  3273. Γöé              Γöé (SHORT or USHORT) and two characters (CHAR or UCHAR)     Γöé
  3274. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3275. Γöé MPFROMLONG   Γöé Produces an MPARAM data type from a long integer (LONG   Γöé
  3276. Γöé              Γöé or ULONG)                                                Γöé
  3277. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3278. Γöé PVOIDFROMMP  Γöé Produces a pointer from an MPARAM data type              Γöé
  3279. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3280. Γöé HWNDFROMMP   Γöé Produces a window handle (HWND) from an MPARAM data type Γöé
  3281. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3282. Γöé CHAR1FROMMP  Γöé Produces a character (UCHAR) from bits 0-7 of an         Γöé
  3283. Γöé              Γöé MPARAM data type                                         Γöé
  3284. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3285. Γöé CHAR2FROMMP  Γöé Produces a character (UCHAR) from bits 8-15 of an        Γöé
  3286. Γöé              Γöé MPARAM data type                                         Γöé
  3287. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3288. Γöé CHAR3FROMMP  Γöé Produces a character (UCHAR) from bits 16-23 of an       Γöé
  3289. Γöé              Γöé MPARAM data type                                         Γöé
  3290. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3291. Γöé CHAR4FROMMP  Γöé Produces a character (UCHAR) from bits 24-31 of an       Γöé
  3292. Γöé              Γöé MPARAM data type                                         Γöé
  3293. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3294. Γöé SHORT1FROMMP Γöé Produces an unsigned short integer (USHORT) from         Γöé
  3295. Γöé              Γöé bits 0-15 of an MPARAM data type                         Γöé
  3296. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3297. Γöé SHORT2FROMMP Γöé Produces an unsigned short integer (USHORT) from bits    Γöé
  3298. Γöé              Γöé 16-31 of an MPARAM data type                             Γöé
  3299. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3300. Γöé LONGFROMMP   Γöé Produces an unsigned long integer (ULONG) from an        Γöé
  3301. Γöé              Γöé MPARAM data type                                         Γöé
  3302. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3303.  
  3304.  
  3305. ΓòÉΓòÉΓòÉ 7.4. New Presentation Manager Functions in OS/2 Version 2.0 ΓòÉΓòÉΓòÉ
  3306.  
  3307. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3308. Γöé New Presentation Manager Functions in OS/2 Version 2.0                  Γöé
  3309. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3310. Γöé FUNCTION                    Γöé DESCRIPTION                               Γöé
  3311. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3312. Γöé WinInsertLboxItem()         Γöé Inserts a listbox item                    Γöé
  3313. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3314. Γöé WinDeleteLboxItem()         Γöé Deletes a listbox item                    Γöé
  3315. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3316. Γöé WinSetLboxItemText()        Γöé Sets the text of a specified listbox item Γöé
  3317. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3318. Γöé WinQueryLboxCount()         Γöé Returns the number of items in a listbox  Γöé
  3319. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3320. Γöé WinQueryLboxSelectedItem()  Γöé Returns the offset (item number) of the   Γöé
  3321. Γöé                             Γöé selected item in a listbox                Γöé
  3322. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3323. Γöé WinQueryLboxItemText()      Γöé Returns the text of a specified listbox   Γöé
  3324. Γöé                             Γöé item                                      Γöé
  3325. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3326. Γöé WinQueryLboxItemTextLength()Γöé(Returns the length of the text of a       Γöé
  3327. Γöé                             Γöé specified listbox item                    Γöé
  3328. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3329. Γöé WinPopupMenu()              Γöé Creates and presents a context (popup)    Γöé
  3330. Γöé                             Γöé menu                                      Γöé
  3331. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3332. Γöé WinCheckMenuItem()          Γöé Sets a check mark against a pulldown      Γöé
  3333. Γöé                             Γöé menu item                                 Γöé
  3334. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3335. Γöé WinIsMenuItemChecked()      Γöé Determines whether a menu item is         Γöé
  3336. Γöé                             Γöé currently checked                         Γöé
  3337. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3338. Γöé WinEnableMenuItem()         Γöé Enables or disables a menu bar or         Γöé
  3339. Γöé                             Γöé pulldown menu item                        Γöé
  3340. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3341. Γöé WinIsMenuItemEnabled()      Γöé Determines whether a menu bar or pulldown Γöé
  3342. Γöé                             Γöé menu item is currently enabled            Γöé
  3343. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3344. Γöé WinSetMenuItemText()        Γöé Sets the text of a specified menu bar or  Γöé
  3345. Γöé                             Γöé pulldown menu item                        Γöé
  3346. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3347. Γöé WinFileDlg()                Γöé Displays the standard SAA-conforming file Γöé
  3348. Γöé                             Γöé dialog box                                Γöé
  3349. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3350. Γöé WinDefFileDlgProc()         Γöé Default processing function for           Γöé
  3351. Γöé                             Γöé subclassing file dialog box               Γöé
  3352. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3353. Γöé WinFontDlg()                Γöé Displays the standard SAA-conforming font Γöé
  3354. Γöé                             Γöé dialog box                                Γöé
  3355. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3356. Γöé WinDefFontDlgProc()         Γöé Default processing function for           Γöé
  3357. Γöé                             Γöé subclassing font dialog box               Γöé
  3358. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3359. Γöé WinQueryButtonCheckstate()  Γöé Determines the current check state of a   Γöé
  3360. Γöé                             Γöé check box or 3-state button.              Γöé
  3361. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3362. Γöé WinSetDesktopBkgnd()        Γöé Sets the current desktop background       Γöé
  3363. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3364. Γöé WinQueryDesktopBackground() Γöé Queries information about the current     Γöé
  3365. Γöé                             Γöé desktop background                        Γöé
  3366. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3367.  
  3368.  
  3369. ΓòÉΓòÉΓòÉ 7.5. Type Prefixes for Symbolic Constants ΓòÉΓòÉΓòÉ
  3370.  
  3371.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3372.  Γöé          Type Prefixes for Symbolic Constants                Γöé
  3373.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3374.  Γöé ITEM                                Γöé CONSTANT TYPE Γöé PREFIX Γöé
  3375.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3376.  Γöé Menu Item (Command)                 Γöé Integer       Γöé MI_    Γöé
  3377.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3378.  Γöé Check Box                           Γöé Integer       Γöé CK_    Γöé
  3379.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3380.  Γöé Entry Field                         Γöé Integer       Γöé EF_    Γöé
  3381.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3382.  Γöé List Box                            Γöé Integer       Γöé LB_    Γöé
  3383.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3384.  Γöé Push Button                         Γöé Integer       Γöé PB_    Γöé
  3385.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3386.  Γöé Radio Button                        Γöé Integer       Γöé RB_    Γöé
  3387.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3388.  Γöé Static Text String                  Γöé String        Γöé STR_   Γöé
  3389.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3390.  Γöé Window Class                        Γöé String        Γöé WC_    Γöé
  3391.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3392.  Γöé Dialog Class                        Γöé String        Γöé DC_    Γöé
  3393.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3394.  Γöé Message Class (Application-defined) Γöé Integer       Γöé WMP_   Γöé
  3395.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3396.  
  3397.  
  3398. ΓòÉΓòÉΓòÉ 7.6. Type Prefixes for Variables ΓòÉΓòÉΓòÉ
  3399.  
  3400.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3401.  Γöé          Type Prefixes for Variables                         Γöé
  3402.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3403.  Γöé DATA TYPE                           Γöé DEFINITION    Γöé PREFIX Γöé
  3404.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3405.  Γöé Boolean                             Γöé BOOL (flag)   Γöé f      Γöé
  3406.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3407.  Γöé Character                           Γöé CHAR          Γöé ch     Γöé
  3408.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3409.  Γöé Unsigned character                  Γöé UCHAR         Γöé uch    Γöé
  3410.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3411.  Γöé String                              Γöé CHAR[]        Γöé sz     Γöé
  3412.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3413.  Γöé Short integer                       Γöé SHORT         Γöé s      Γöé
  3414.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3415.  Γöé Unsigned short integer              Γöé USHORT        Γöé us     Γöé
  3416.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3417.  Γöé Long integer                        Γöé LONG          Γöé l      Γöé
  3418.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3419.  Γöé Unsigned long integer               Γöé ULONG         Γöé ul     Γöé
  3420.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3421.  Γöé Handle                              Γöé HWND, HMODULE,Γöé h      Γöé
  3422.  Γöé                                     Γöé etc           Γöé        Γöé
  3423.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3424.  
  3425.  
  3426. ΓòÉΓòÉΓòÉ 7.7. Type Prefixes for Pointers ΓòÉΓòÉΓòÉ
  3427.  
  3428.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3429.  Γöé          Type Prefixes for Pointers                          Γöé
  3430.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3431.  Γöé DATA TYPE                           Γöé DEFINITION    Γöé PREFIX Γöé
  3432.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3433.  Γöé Pointer to CHAR                     Γöé CHAR *        Γöé pch    Γöé
  3434.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3435.  Γöé Pointer to string                   Γöé PSZ           Γöé psz    Γöé
  3436.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3437.  Γöé Pointer to function                 Γöé PFN, PFNWP    Γöé pfn    Γöé
  3438.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3439.  
  3440.  
  3441. ΓòÉΓòÉΓòÉ 7.8. Memory Management Functions ΓòÉΓòÉΓòÉ
  3442.  
  3443.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3444.  Γöé Memory Management Functions.  This table compares the OS/2   Γöé
  3445.  Γöé Version 1.3 and OS/2 Version 2.0 memory allocation and       Γöé
  3446.  Γöé management functions.                                        Γöé
  3447.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3448.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3449.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3450.  Γöé DosAllocSeg                   Γöé N/A                          Γöé
  3451.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3452.  Γöé DosAllocShrSeg                Γöé N/A                          Γöé
  3453.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3454.  Γöé DosGetShrSeg                  Γöé N/A                          Γöé
  3455.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3456.  Γöé DosGetSeg                     Γöé N/A                          Γöé
  3457.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3458.  Γöé DosGiveSeg                    Γöé N/A                          Γöé
  3459.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3460.  Γöé DosReallocSeg                 Γöé N/A                          Γöé
  3461.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3462.  Γöé DosFreeSeg                    Γöé N/A                          Γöé
  3463.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3464.  Γöé DosAllocHuge                  Γöé N/A                          Γöé
  3465.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3466.  Γöé DosGetHugeShift               Γöé N/A                          Γöé
  3467.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3468.  Γöé DosReallocHuge                Γöé N/A                          Γöé
  3469.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3470.  Γöé DosCreateCSAlias              Γöé N/A                          Γöé
  3471.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3472.  Γöé DosLockSeg                    Γöé N/A                          Γöé
  3473.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3474.  Γöé DosUnLockSeg                  Γöé N/A                          Γöé
  3475.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3476.  Γöé DosMemAvail                   Γöé N/A                          Γöé
  3477.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3478.  Γöé DosSizeSeg                    Γöé N/A                          Γöé
  3479.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3480.  Γöé DosGetResource                Γöé DosGetResource               Γöé
  3481.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3482.  Γöé DosSubAlloc                   Γöé DosSubAlloc                  Γöé
  3483.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3484.  Γöé DosSubFree                    Γöé DosSubFree                   Γöé
  3485.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3486.  Γöé DosSubSet                     Γöé DosSubSet                    Γöé
  3487.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3488.  Γöé N/A                           Γöé DosSubUnSet                  Γöé
  3489.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3490.  Γöé N/A                           Γöé DosAllocMem                  Γöé
  3491.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3492.  Γöé N/A                           Γöé DosAllocSharedMem            Γöé
  3493.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3494.  Γöé N/A                           Γöé DosGetNamedSharedMem         Γöé
  3495.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3496.  Γöé N/A                           Γöé DosGetSharedMem              Γöé
  3497.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3498.  Γöé N/A                           Γöé DosGiveSharedMem             Γöé
  3499.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3500.  Γöé N/A                           Γöé DosFreeMem                   Γöé
  3501.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3502.  Γöé N/A                           Γöé DosSetMem                    Γöé
  3503.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3504.  Γöé N/A                           Γöé DosQueryMem                  Γöé
  3505.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3506.  
  3507.  
  3508. ΓòÉΓòÉΓòÉ 7.9. Session Management Functions ΓòÉΓòÉΓòÉ
  3509.  
  3510.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3511.  Γöé Session Management Functions.  This table compares the OS/2  Γöé
  3512.  Γöé Version 1.3 and OS/2 Version 2.0 session management          Γöé
  3513.  Γöé functions.                                                   Γöé
  3514.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3515.  Γöé 16-BIT FUNCTIONS NAME         Γöé 32-BIT FUNCTION NAME         Γöé
  3516.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3517.  Γöé DosStartSession               Γöé DosStartSession              Γöé
  3518.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3519.  Γöé DosSetSession                 Γöé DosSetSession                Γöé
  3520.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3521.  Γöé DosSelectSession              Γöé DosSelectSession             Γöé
  3522.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3523.  Γöé DosStopSession                Γöé DosStopSession               Γöé
  3524.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3525.  Γöé DosSMRegisterDD               Γöé N/A                          Γöé
  3526.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3527.  
  3528.  
  3529. ΓòÉΓòÉΓòÉ 7.10. Task Management Functions ΓòÉΓòÉΓòÉ
  3530.  
  3531.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3532.  Γöé Task Management Functions.  This table compares the OS/2     Γöé
  3533.  Γöé Version 1.3 and OS/2 Version 2.0 task management functions.  Γöé
  3534.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3535.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3536.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3537.  Γöé DosCreateThread               Γöé DosCreateThread              Γöé
  3538.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3539.  Γöé DosCWait                      Γöé DosWaitChild                 Γöé
  3540.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3541.  Γöé N/A                           Γöé DosWaitThread                Γöé
  3542.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3543.  Γöé DosResumeThread               Γöé DosResumeThread              Γöé
  3544.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3545.  Γöé DosSuspendThread              Γöé DosSuspendThread             Γöé
  3546.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3547.  Γöé DosEnterCritSec               Γöé DosEnterCritSec              Γöé
  3548.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3549.  Γöé DosExecPgm                    Γöé DosExecPgm                   Γöé
  3550.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3551.  Γöé DosExit                       Γöé DosExit                      Γöé
  3552.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3553.  Γöé DosExitCritSec                Γöé DosExitCritSec               Γöé
  3554.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3555.  Γöé DosExitList                   Γöé DosExitList                  Γöé
  3556.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3557.  Γöé DosGetInfoSeg                 Γöé N/A                          Γöé
  3558.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3559.  Γöé N/A                           Γöé DosGetInfoBlocks             Γöé
  3560.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3561.  Γöé DosGetPrty                    Γöé N/A                          Γöé
  3562.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3563.  Γöé DosKillProcess                Γöé DosKillProcess               Γöé
  3564.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3565.  Γöé N/A                           Γöé DosKillThread                Γöé
  3566.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3567.  Γöé DosSetPrty                    Γöé DosSetPriority               Γöé
  3568.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3569.  Γöé DosGetPID                     Γöé N/A                          Γöé
  3570.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3571.  Γöé DosGetPPID                    Γöé N/A                          Γöé
  3572.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3573.  Γöé DosR2StackRealloc             Γöé N/A                          Γöé
  3574.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3575.  Γöé DosCallBack                   Γöé N/A                          Γöé
  3576.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3577.  Γöé DosRetForward                 Γöé N/A                          Γöé
  3578.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3579.  Γöé N/A                           Γöé DosDebug                     Γöé
  3580.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3581.  Γöé DosPTrace                     Γöé N/A                          Γöé
  3582.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3583.  
  3584.  
  3585. ΓòÉΓòÉΓòÉ 7.11. Exception Handling Functions ΓòÉΓòÉΓòÉ
  3586.  
  3587.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3588.  Γöé Exception Handling Functions.  This table compares the OS/2  Γöé
  3589.  Γöé Version 1.3 and OS/2 Version 2.0 signal and exception        Γöé
  3590.  Γöé handling functions.                                          Γöé
  3591.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3592.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3593.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3594.  Γöé DosHoldSignal                 Γöé N/A                          Γöé
  3595.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3596.  Γöé DosSetSignalHandler           Γöé N/A                          Γöé
  3597.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3598.  Γöé DosSendSignal                 Γöé N/A                          Γöé
  3599.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3600.  Γöé N/A                           Γöé DosSetKBDSigFocus            Γöé
  3601.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3602.  Γöé DosSetVec                     Γöé N/A                          Γöé
  3603.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3604.  Γöé N/A                           Γöé DosSetExceptionHandler       Γöé
  3605.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3606.  Γöé N/A                           Γöé DosUnSetExceptionHandler     Γöé
  3607.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3608.  Γöé N/A                           Γöé DosRaiseException            Γöé
  3609.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3610.  Γöé N/A                           Γöé DosUnwindException           Γöé
  3611.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3612.  
  3613.  
  3614. ΓòÉΓòÉΓòÉ 7.12. Anonymous Pipe Functions ΓòÉΓòÉΓòÉ
  3615.  
  3616.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3617.  Γöé Anonymous Pipe Functions.  This table compares the OS/2      Γöé
  3618.  Γöé Version 1.3 and OS/2 Version 2.0 anonymous pipe functions.   Γöé
  3619.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3620.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3621.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3622.  Γöé DosMakePipe                   Γöé DosCreatePipe                Γöé
  3623.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3624.  
  3625.  
  3626. ΓòÉΓòÉΓòÉ 7.13. Named Pipe Functions ΓòÉΓòÉΓòÉ
  3627.  
  3628.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3629.  Γöé Named Pipe Functions.  This table compares the OS/2 Version  Γöé
  3630.  Γöé 1.3 and OS/2 Version 2.0 named pipe functions.               Γöé
  3631.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3632.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3633.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3634.  Γöé DosCallNmPipe                 Γöé DosCallNPipe                 Γöé
  3635.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3636.  Γöé DosConnectNmPipe              Γöé DosConnectNPipe              Γöé
  3637.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3638.  Γöé DosDisConnectNmPipe           Γöé DosDisConnectNPipe           Γöé
  3639.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3640.  Γöé DosMakeNmPipe                 Γöé DosCreateNpipe               Γöé
  3641.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3642.  Γöé DosPeekNmPipe                 Γöé DosPeekNPipe                 Γöé
  3643.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3644.  Γöé DosQNmPHandState              Γöé DosQueryNPHState             Γöé
  3645.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3646.  Γöé DosQNmPipeInfo                Γöé DosQueryNPipeInfo            Γöé
  3647.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3648.  Γöé DosQNmPipeSemState            Γöé DosQueryNPipeSemState        Γöé
  3649.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3650.  Γöé DosRawReadNmPipe              Γöé DosRawReadNPipe              Γöé
  3651.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3652.  Γöé DosRawWriteNmPipe             Γöé DosRawWriteNPipe             Γöé
  3653.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3654.  Γöé DosSetNmPHandInfo             Γöé DosSetNPHState               Γöé
  3655.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3656.  Γöé DosSetNmPipeSem               Γöé DosSetNPipeSem               Γöé
  3657.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3658.  Γöé DosTransactNmPipe             Γöé DosTransactNPipe             Γöé
  3659.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3660.  Γöé DosWaitNmPipe                 Γöé DosWaitNPipe                 Γöé
  3661.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3662.  
  3663.  
  3664. ΓòÉΓòÉΓòÉ 7.14. Queue Functions ΓòÉΓòÉΓòÉ
  3665.  
  3666.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3667.  ΓöéQueue Functions.  This table compares the OS/2 Version 1.3    Γöé
  3668.  Γöé and OS/2 Version 2.0 queue management functions.             Γöé
  3669.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3670.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3671.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3672.  Γöé DosCreateQueue                Γöé DosCreateQueue               Γöé
  3673.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3674.  Γöé DosOpenQueue                  Γöé DosOpenQueue                 Γöé
  3675.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3676.  Γöé DosCloseQueue                 Γöé DosCloseQueue                Γöé
  3677.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3678.  Γöé DosPeekQueue                  Γöé DosPeekQueue                 Γöé
  3679.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3680.  Γöé DosPurgeQueue                 Γöé DosPurgeQueue                Γöé
  3681.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3682.  Γöé DosQueryQueue                 Γöé DosQueryQueue                Γöé
  3683.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3684.  Γöé DosReadQueue                  Γöé DosReadQueue                 Γöé
  3685.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3686.  Γöé DosWriteQueue                 Γöé DosWriteQueue                Γöé
  3687.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3688.  
  3689.  
  3690. ΓòÉΓòÉΓòÉ 7.15. Semaphore Functions ΓòÉΓòÉΓòÉ
  3691.  
  3692.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3693.  Γöé Semaphore Functions.  This table compares the OS/2 Version   Γöé
  3694.  Γöé 1.3 and OS/2 Version 2.0 semaphore functions.                Γöé
  3695.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3696.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3697.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3698.  Γöé DosSemClear                   Γöé N/A                          Γöé
  3699.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3700.  Γöé DosSemRequest                 Γöé N/A                          Γöé
  3701.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3702.  Γöé DosSemSet                     Γöé N/A                          Γöé
  3703.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3704.  Γöé DosSemSetWait                 Γöé N/A                          Γöé
  3705.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3706.  Γöé DosSemWait                    Γöé N/A                          Γöé
  3707.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3708.  Γöé DosMuxSemWait                 Γöé N/A                          Γöé
  3709.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3710.  Γöé DosCloseSem                   Γöé N/A                          Γöé
  3711.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3712.  Γöé DosCreateSem                  Γöé N/A                          Γöé
  3713.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3714.  Γöé DosOpenSem                    Γöé N/A                          Γöé
  3715.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3716.  Γöé DosFSRamSemRequest            Γöé N/A                          Γöé
  3717.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3718.  Γöé DosFSRamSemClear              Γöé N/A                          Γöé
  3719.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3720.  Γöé N/A                           Γöé DosCreateMutexSem            Γöé
  3721.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3722.  Γöé N/A                           Γöé DosOpenMutexSem              Γöé
  3723.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3724.  Γöé N/A                           Γöé DosCloseMutexSem             Γöé
  3725.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3726.  Γöé N/A                           Γöé DosRequestMutexSem           Γöé
  3727.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3728.  Γöé N/A                           Γöé DosReleaseMutexSem           Γöé
  3729.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3730.  Γöé N/A                           Γöé DosQueryMutexSem             Γöé
  3731.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3732.  Γöé N/A                           Γöé DosCreateEventSem            Γöé
  3733.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3734.  Γöé N/A                           Γöé DosOpenEventSem              Γöé
  3735.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3736.  Γöé N/A                           Γöé DosCloseEventSem             Γöé
  3737.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3738.  Γöé N/A                           Γöé DosResetEventSem             Γöé
  3739.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3740.  Γöé N/A                           Γöé DosPostEventSem              Γöé
  3741.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3742.  Γöé N/A                           Γöé DosWaitEventSem              Γöé
  3743.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3744.  Γöé N/A                           Γöé DosQueryEventSem             Γöé
  3745.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3746.  Γöé N/A                           Γöé DosCreateMuxWaitSem          Γöé
  3747.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3748.  Γöé N/A                           Γöé DosOpenMuxWaitSem            Γöé
  3749.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3750.  Γöé N/A                           Γöé DosCloseMuxWaitSem           Γöé
  3751.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3752.  Γöé N/A                           Γöé DosWaitMuxWaitSem            Γöé
  3753.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3754.  Γöé N/A                           Γöé DosAddMuxWaitSem             Γöé
  3755.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3756.  Γöé N/A                           Γöé DosDeleteMuxWaitSem          Γöé
  3757.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3758.  Γöé N/A                           Γöé DosQueryMuxWaitSem           Γöé
  3759.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3760.  
  3761.  
  3762. ΓòÉΓòÉΓòÉ 7.16. Message Retrieval Functions ΓòÉΓòÉΓòÉ
  3763.  
  3764.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3765.  Γöé Message Retrieval Functions.  This table compares the OS/2   Γöé
  3766.  Γöé Version 1.3 and OS/2 Version 2.0 message retrieval functions.Γöé
  3767.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3768.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3769.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3770.  Γöé DosGetMessage                 Γöé DosGetMessage                Γöé
  3771.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3772.  Γöé DosInsMessage                 Γöé DosInsertMessage             Γöé
  3773.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3774.  Γöé DosPutMessage                 Γöé DosPutMessage                Γöé
  3775.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3776.  
  3777.  
  3778. ΓòÉΓòÉΓòÉ 7.17. Timer Services Functions ΓòÉΓòÉΓòÉ
  3779.  
  3780.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3781.  Γöé Timer Services Functions.  This table compares the OS/2      Γöé
  3782.  Γöé Version 1.3 and OS/2 Version 2.0 timer services functions.   Γöé
  3783.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3784.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3785.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3786.  Γöé DosGetDateTime                Γöé DosGetDateTime               Γöé
  3787.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3788.  Γöé DosSetDateTime                Γöé DosSetDateTime               Γöé
  3789.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3790.  Γöé DosSleep                      Γöé DosSleep                     Γöé
  3791.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3792.  Γöé DosTimerAsync                 Γöé DosAsyncTimer                Γöé
  3793.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3794.  Γöé DosTimerStart                 Γöé DosStartTimer                Γöé
  3795.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3796.  Γöé DosTimerStop                  Γöé DosStopTimer                 Γöé
  3797.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3798.  
  3799.  
  3800. ΓòÉΓòÉΓòÉ 7.18. Dynamic Linking Functions ΓòÉΓòÉΓòÉ
  3801.  
  3802.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3803.  Γöé Dynamic Linking Functions.  This table compares the OS/2     Γöé
  3804.  Γöé Version 1.3 and OS/2 Version 2.0 dynamic linking functions.  Γöé
  3805.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3806.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3807.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3808.  Γöé DosLoadModule                 Γöé DosLoadModule                Γöé
  3809.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3810.  Γöé DosFreeModule                 Γöé DosFreeModule                Γöé
  3811.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3812.  Γöé DosGetProcAddr                Γöé DosQueryProcAddr             Γöé
  3813.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3814.  Γöé DosGetModHandle               Γöé DosQueryModuleHandle         Γöé
  3815.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3816.  Γöé DosGetModName                 Γöé DosQueryModuleName           Γöé
  3817.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3818.  Γöé DosQAppType                   Γöé DosQueryAppType              Γöé
  3819.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3820.  Γöé DosGetMachineMode             Γöé N/A                          Γöé
  3821.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3822.  Γöé BadDynLink                    Γöé N/A                          Γöé
  3823.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3824.  Γöé DosGetVersion                 Γöé N/A                          Γöé
  3825.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3826.  Γöé DosGetEnv                     Γöé N/A                          Γöé
  3827.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3828.  
  3829.  
  3830. ΓòÉΓòÉΓòÉ 7.19. Device I/O Functions ΓòÉΓòÉΓòÉ
  3831.  
  3832.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3833.  Γöé Device I/O Functions.  This table compares the OS/2 Version  Γöé
  3834.  Γöé 1.3 and OS/2 Version 2.0 device I/O functions.               Γöé
  3835.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3836.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3837.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3838.  Γöé DosBeep                       Γöé DosBeep                      Γöé
  3839.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3840.  Γöé DosCLIAccess                  Γöé N/A                          Γöé
  3841.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3842.  Γöé DosPortAccess                 Γöé N/A                          Γöé
  3843.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3844.  Γöé DosDevConfig                  Γöé DosDevConfig                 Γöé
  3845.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3846.  Γöé DosPhysicalDisk               Γöé DosPhysicalDisk              Γöé
  3847.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3848.  
  3849.  
  3850. ΓòÉΓòÉΓòÉ 7.20. File I/O Functions ΓòÉΓòÉΓòÉ
  3851.  
  3852.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3853.  Γöé File I/O Functions.  This table compares OS/2 Version 1.3    Γöé
  3854.  Γöé and OS/2 Version 2.0 file I/O functions.                     Γöé
  3855.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3856.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3857.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3858.  Γöé DosBufReset                   Γöé DosResetBuffer               Γöé
  3859.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3860.  Γöé DosChDir                      Γöé DosSetCurrentDir             Γöé
  3861.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3862.  Γöé DosChgFilePtr                 Γöé DosSetFilePtr                Γöé
  3863.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3864.  Γöé DosClose                      Γöé DosClose                     Γöé
  3865.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3866.  Γöé DosDelete                     Γöé DosDelete                    Γöé
  3867.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3868.  Γöé DosDevIOCTL                   Γöé DosDevIOCTL                  Γöé
  3869.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3870.  Γöé DosDupHandle                  Γöé DosDupHandle                 Γöé
  3871.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3872.  Γöé DosEditName                   Γöé DosEditName                  Γöé
  3873.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3874.  Γöé DosFileIO                     Γöé DosFileIO                    Γöé
  3875.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3876.  Γöé DosFileLocks                  Γöé DosSetFileLocks              Γöé
  3877.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3878.  Γöé DosFindClose                  Γöé DosFindClose                 Γöé
  3879.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3880.  Γöé DosFindFirst                  Γöé DosFindFirst                 Γöé
  3881.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3882.  Γöé DosFindNext                   Γöé DosFindNext                  Γöé
  3883.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3884.  Γöé DosFindNotifyClose            Γöé DosFindNotifyClose           Γöé
  3885.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3886.  Γöé DosFindNotifyFirst            Γöé DosFindNotifyFirst           Γöé
  3887.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3888.  Γöé DosFindNotifyNext             Γöé DosFindNotifyNext            Γöé
  3889.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3890.  Γöé DosFSAttach                   Γöé DosFSAttach                  Γöé
  3891.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3892.  Γöé DosFSCtl                      Γöé DosFSCtl                     Γöé
  3893.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3894.  Γöé DosMkDir                      Γöé DosCreateDir                 Γöé
  3895.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3896.  Γöé DosMove                       Γöé DosMove                      Γöé
  3897.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3898.  Γöé DosNewSize                    Γöé DosSetFileSize               Γöé
  3899.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3900.  Γöé DosOpen                       Γöé DosOpen                      Γöé
  3901.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3902.  Γöé DosQCurDir                    Γöé DosQueryCurrentDir           Γöé
  3903.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3904.  Γöé DosQCurDisk                   Γöé DosQueryCurrentDisk          Γöé
  3905.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3906.  Γöé DosQFHandState                Γöé DosQueryFHState              Γöé
  3907.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3908.  Γöé DosQFileInfo                  Γöé DosQueryFileInfo             Γöé
  3909.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3910.  Γöé DosQFileMode                  Γöé DosQueryFileMode             Γöé
  3911.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3912.  Γöé DosQFSAttach                  Γöé DosQueryFSAttach             Γöé
  3913.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3914.  Γöé DosQFSinfo                    Γöé DosQueryFSInfo               Γöé
  3915.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3916.  Γöé DosQHandType                  Γöé DosQueryHType                Γöé
  3917.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3918.  Γöé DosQPathInfo                  Γöé DosQueryPathInfo             Γöé
  3919.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3920.  Γöé DosQSysInfo                   Γöé DosQuerySysInfo              Γöé
  3921.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3922.  Γöé DosQVerify                    Γöé DosQueryVerify               Γöé
  3923.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3924.  Γöé DosRead                       Γöé DosRead                      Γöé
  3925.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3926.  Γöé DosReadAsync                  Γöé N/A                          Γöé
  3927.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3928.  Γöé DosRmDir                      Γöé DosDeleteDir                 Γöé
  3929.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3930.  Γöé DosScanEnv                    Γöé DosScanEnv                   Γöé
  3931.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3932.  Γöé DosSearchPath                 Γöé DosSearchPath                Γöé
  3933.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3934.  Γöé DosSelectDisk                 Γöé DosSetDefaultDisk            Γöé
  3935.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3936.  Γöé DosSetFHandState              Γöé DosSetFHState                Γöé
  3937.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3938.  Γöé DosSetFileInfo                Γöé DosSetFileInfo               Γöé
  3939.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3940.  Γöé DosSetFileMode                Γöé DosSetFileMode               Γöé
  3941.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3942.  Γöé DosSetFsInfo                  Γöé DosSetFsInfo                 Γöé
  3943.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3944.  Γöé DosSetMaxFH                   Γöé DosSetMaxFH                  Γöé
  3945.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3946.  Γöé DosSetPathInfo                Γöé DosSetPathInfo               Γöé
  3947.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3948.  Γöé DosSetVerify                  Γöé DosSetVerify                 Γöé
  3949.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3950.  Γöé DosWrite                      Γöé DosWrite                     Γöé
  3951.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3952.  Γöé DosWriteAsync                 Γöé N/A                          Γöé
  3953.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3954.  
  3955.  
  3956. ΓòÉΓòÉΓòÉ 7.21. Code Page Functions ΓòÉΓòÉΓòÉ
  3957.  
  3958.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3959.  Γöé Code Page Functions.  This table compares the OS/2 Version   Γöé
  3960.  Γöé 1.3 and OS/2 Version 2.0 file code page support functions.   Γöé
  3961.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3962.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3963.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3964.  Γöé DosSetCp                      Γöé N/A                          Γöé
  3965.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3966.  Γöé DosSetProcCp                  Γöé DosSetProcessCp              Γöé
  3967.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3968.  Γöé DosGetCp                      Γöé DosQueryCp                   Γöé
  3969.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3970.  Γöé DosGetCtryInfo                Γöé DosQueryCtryInfo             Γöé
  3971.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3972.  Γöé DosCaseMap                    Γöé N/A                          Γöé
  3973.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3974.  Γöé DosGetDBCSEv                  Γöé DosQueryDBCSEnv              Γöé
  3975.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3976.  Γöé DosGetCollate                 Γöé DosQueryCollate              Γöé
  3977.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3978.  
  3979.  
  3980. ΓòÉΓòÉΓòÉ 7.22. Error Management Functions ΓòÉΓòÉΓòÉ
  3981.  
  3982.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3983.  Γöé Error Management Functions.  This table compares the OS/2    Γöé
  3984.  Γöé Version 1.3 and OS/2 Version 2.0 error management functions. Γöé
  3985.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3986.  Γöé 16-BIT FUNCTION NAME          Γöé 32-BIT FUNCTION NAME         Γöé
  3987.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3988.  Γöé DosErrClass                   Γöé DosErrClass                  Γöé
  3989.  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3990.  Γöé DosError                      Γöé DosError                     Γöé
  3991.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3992.  
  3993.  
  3994. ΓòÉΓòÉΓòÉ 8. Special Notices ΓòÉΓòÉΓòÉ
  3995.  
  3996. This publication is intended to help the customer in the design and 
  3997. implementation of OS/2 Presentation Manager applications under OS/2 Version 
  3998. 2.0, using object-oriented design and programming principles.  The information 
  3999. in this publication is not intended as the specification of any programming 
  4000. interfaces that are provided by OS/2 Version 2.0.  See the PUBLICATIONS section 
  4001. of the IBM Programming Announcement for OS/2 Version 2.0 for more information 
  4002. about what publications are considered to be product documentation. 
  4003.  
  4004. References in this publication to IBM products, programs or services do not 
  4005. imply that IBM intends to make these available in all countries in which IBM 
  4006. operates.  Any reference to an IBM product, program, or service is not intended 
  4007. to state or imply that only IBM's product, program, or service may be used. 
  4008. Any functionally equivalent program that does not infringe any of IBM's 
  4009. intellectual property rights may be used instead of the IBM product, program or 
  4010. service. 
  4011.  
  4012. Information in this book was developed in conjunction with use of the equipment 
  4013. specified, and is limited in application to those specific hardware and 
  4014. software products and levels. 
  4015.  
  4016. IBM may have patents or pending patent applications covering subject matter in 
  4017. this document.  The furnishing of this document does not give you any license 
  4018. to these patents.  You can send license inquiries, in writing, to the IBM 
  4019. Director of Commercial Relations, IBM Corporation, Purchase, NY 10577. 
  4020.  
  4021. The information contained in this document has not been submitted to any formal 
  4022. IBM test and is distributed AS IS. 
  4023.  
  4024. The information about non-IBM ("vendor") products in this manual has been 
  4025. supplied by the vendor and IBM assumes no responsibility for its accuracy 
  4026. completeness. 
  4027.  
  4028. The use of this information or the implementation of any of these techniques is 
  4029. a customer responsibility and depends on the customer's ability to evaluate and 
  4030. integrate them into the customer's operational environment.  While each item 
  4031. may have been reviewed by IBM for accuracy in a specific situation, there is no 
  4032. guarantee that the same or similar results will be obtained elsewhere. 
  4033. Customers attempting to adapt these techniques to their own environments do so 
  4034. at their own risk. 
  4035.  
  4036. The following document contains examples of data and reports used in daily 
  4037. business operations.  To illustrate them as completely as possible, the 
  4038. examples contain the names of individuals, companies, brands, and products. All 
  4039. of these names are fictitious and any similarity to the names and addresses 
  4040. used by an actual business enterprise is entirely coincidental. 
  4041.  
  4042. The following terms, which are denoted by an asterisk (*) in this publication, 
  4043. are trademarks of the International Business Machines Corporation in the United 
  4044. States and/or other countries: 
  4045.  
  4046.  C/2
  4047.  COBOL/2
  4048.  Common User Access
  4049.  CommonView
  4050.  CUA
  4051.  DATABASE 2
  4052.  DB2
  4053.  DCF
  4054.  Document Composition Facility
  4055.  FORTRAN/2
  4056.  IBM
  4057.  Macro Assembler/2
  4058.  Micro Channel
  4059.  OfficeVision
  4060.  Operating System/2
  4061.  OS/2
  4062.  Personal System/2
  4063.  Presentation Manager
  4064.  PS/2
  4065.  SAA
  4066.  System/370
  4067.  Systems Application Architecture
  4068.  WIN-OS/2
  4069.  Workplace Shell
  4070.  
  4071. The following terms, which are denoted by a double asterisk (**) in this 
  4072. publication, are trademarks of other companies. 
  4073.  
  4074.  Intel is a trademark of Intel Corporation.
  4075.  Lotus is a trademark of the Lotus Development Corporation.
  4076.  Microsoft is a trademark of Microsoft Corporation.
  4077.  MS-DOS is a registered trademark of Microsoft Corporation.
  4078.  Smalltalk/V is a trademark of Digitalk Inc.
  4079.  Windows is a trademark of Microsoft Corporation.
  4080.  286, 386, 486, SX are trademarks of Intel Corporation.
  4081.  
  4082.  
  4083. ΓòÉΓòÉΓòÉ 9. Preface ΓòÉΓòÉΓòÉ
  4084.  
  4085. This document is intended as a general introduction to the concepts involved in 
  4086. the design and implementation of applications which will execute in the OS/2 
  4087. Presentation Manager and Workplace Shell environments under OS/2 Version 2.0. 
  4088. It is not intended to be an exhaustive reference on the subject of Presentation 
  4089. Manager programming, and should be used in conjunction with the official IBM 
  4090. product documentation, and other reference books and documents, which are 
  4091. mentioned herein. 
  4092.  
  4093. It must be stressed that this document is not intended to teach the reader how 
  4094. to program in the "C" language or how to use the Presentation Manager 
  4095. programming interface, nor is it intended to teach the theory of 
  4096. object-oriented programming.  Rather, it serves as a guide to the integration 
  4097. of various object-oriented software engineering techniques with the 
  4098. Presentation Manager application model, in order to produce well-structured, 
  4099. easily-maintainable applications which conform to CUA  guidelines. 
  4100.  
  4101. The information given in this document is generally independent of programming 
  4102. language implementations (with certain exceptions noted in the text), and may 
  4103. be used to develop applications in any supported programming language. 
  4104. However, programming syntax examples used in this document are shown using the 
  4105. "C" language, since this language is commonly used for Presentation Manager 
  4106. application development, and most clearly illustrates the structure of the 
  4107. Presentation Manager and Workplace Shell application models. 
  4108.  
  4109. This document is intended for: 
  4110.  
  4111.  Application designers, planners and development managers who require an 
  4112.   understanding of the application of object-oriented principles to the 
  4113.   Presentation Manager environment, and the productivity gains to be achieved 
  4114.   from the use of such principles. 
  4115.  
  4116.  Programmers who wish to understand the structure of Presentation Manager and 
  4117.   Workplace Shell applications, and the techniques by which applications may be 
  4118.   constructed so as to achieve maximum function, with optimal levels of 
  4119.   reusability and maintainability. 
  4120.  
  4121. The code examples used in this document are available in electronic form via 
  4122. CompuServe** or through a local IBM Support BBS, as package RB3774.ZIP. IBM 
  4123. employees may obtain the code examples from the package GG243774 PACKAGE on 
  4124. OS2TOOLS. 
  4125.  
  4126. First Edition:  This First Edition includes programming information relating to 
  4127.                 application development under OS/2 Version 2.0, and supercedes 
  4128.                 the ITSC Technical Bulletin Presentation Manager Application 
  4129.                 Development, GG24-3543. 
  4130.  
  4131. The document is organized as follows: 
  4132.  
  4133.  Overview provides a brief introduction to the topics covered in this 
  4134.   document. 
  4135.  
  4136.   This chapter is recommended for all readers of the document. 
  4137.  
  4138.  Operating System/2 provides a brief technical overview of the OS/2 Version 
  4139.   2.0 environment, comparing and contrasting it with the DOS environment and 
  4140.   previous versions of OS/2.  The major features of OS/2 Version 2.0 are 
  4141.   described and their use by applications is discussed. 
  4142.  
  4143.   This chapter is recommended for those readers who are not familiar with the 
  4144.   OS/2 Version 2.0 operating system environment, in order to provide them with 
  4145.   a basic understanding of the capabilities of OS/2 Version 2.0. 
  4146.  
  4147.  Object-Oriented Applications explains the basic principles of object-oriented 
  4148.   design and programming.  The object-oriented approach is compared and 
  4149.   contrasted with the traditional procedural approach in terms of a simple 
  4150.   application model, before the extension of the object-oriented paradigm into 
  4151.   more complex scenarios is discussed.  Some suggestions and guidelines are 
  4152.   also offered with regard to application design and implementation using the 
  4153.   object-oriented approach. 
  4154.  
  4155.   This chapter is recommended for readers who do not already possess an 
  4156.   understanding of the basic principles of object-oriented programming. This 
  4157.   knowledge is essential in order to understand the programming guidelines 
  4158.   presented later in the document. 
  4159.  
  4160.  The Presentation Manager Application Model describes the Presentation Manager 
  4161.   application model, and illustrates the way in which the application model 
  4162.   implements the object-oriented principles introduced in Object-Oriented 
  4163.   Applications. 
  4164.  
  4165.   This chapter is recommended for all readers of this document, since it 
  4166.   explains the basic structure of a Presentation Manager application, and the 
  4167.   way in which the Presentation Manager application model facilitates the 
  4168.   creation of object-oriented applications. 
  4169.  
  4170.  The Flat Memory Model describes the 32-bit flat memory model implemented in 
  4171.   OS/2 Version 2.0, and discusses the programming considerations which arise 
  4172.   from the differences between this memory model and the segmented memory model 
  4173.   used by previous versions of OS/2. 
  4174.  
  4175.   This chapter is recommended for all programmers who intend to develop 
  4176.   applications under OS/2 Version 2.0. 
  4177.  
  4178.  Building a Presentation Manager Application describes the major programming 
  4179.   techniques required to implement a Presentation Manager application, 
  4180.   including recommendations and established conventions in areas such as 
  4181.   methods of opening and closing windows, displaying dialogs, communication 
  4182.   between windows, managing user responsiveness etc.  The chapter also 
  4183.   discusses certain software engineering techniques which may be used to 
  4184.   enhance the level of modularity and optimize the granularity of the resulting 
  4185.   application code. 
  4186.  
  4187.   This chapter is recommended for programmers and development managers who will 
  4188.   be working on the implementation of Presentation Manager applications. 
  4189.  
  4190.  Workplace Shell and the System Object Model describes the system object model 
  4191.   introduced in OS/2 Version 2.0, and its implementation by the OS/2 Version 
  4192.   2.0 Workplace Shell.  The chapter describes the object-oriented application 
  4193.   layer provided by the Workplace Shell, and explains how Workplace Shell 
  4194.   objects are defined, created and implemented. 
  4195.  
  4196.   This chapter is recommended for programmers and development managers who wish 
  4197.   to create objects for use on the Workplace Shell desktop. 
  4198.  
  4199.  Direct Manipulation explains the implementation of direct manipulation (drag 
  4200.   and drop) techniques for carrying out required tasks in the Presentation 
  4201.   Manager and Workplace Shell environments.  The chapter discusses the use of 
  4202.   these techniques both by Presentation Manager windows and by Workplace Shell 
  4203.   objects. 
  4204.  
  4205.   This chapter is recommended for programmers who wish to implement direct 
  4206.   manipulation in their Presentation Manager applications or Workplace Shell 
  4207.   object classes. 
  4208.  
  4209.  Presentation Manager Resources discusses the concept of Presentation Manager 
  4210.   resources.  The chapter covers the types of application resources which may 
  4211.   be defined in the Presentation Manager environment, their definition and 
  4212.   conventions governing their use. 
  4213.  
  4214.   This chapter is recommended for all programmers who will develop Presentation 
  4215.   Manager applications, since resources are used in most if not all 
  4216.   applications. 
  4217.  
  4218.  Multitasking Considerations describes the ways in which multiple threads of 
  4219.   execution may be used within a Presentation Manager application, in order to 
  4220.   isolate long-running application tasks from the user interface and thereby 
  4221.   provide greater application responsiveness to the end user. 
  4222.  
  4223.   This chapter is recommended for programmers and development managers who will 
  4224.   be building Presentation Manager applications which carry out lengthy 
  4225.   processing tasks, or which require access to remote devices or systems. 
  4226.  
  4227.  Systems Application Architecture CUA Considerations discusses the 
  4228.   implementation of various SAA CUA user interface specifications in 
  4229.   Presentation Manager applications.  The chapter provides coding examples for 
  4230.   a number of CUA techniques such as menu bar handling. 
  4231.  
  4232.   This chapter is recommended for programmers who wish to implement SAA CUA 
  4233.   guidelines in their applications. 
  4234.  
  4235.  Application Migration discusses the migration of Presentation Manager 
  4236.   applications to OS/2 Version 2.0 from previous versions of OS/2.  Differences 
  4237.   in implementation are described, along with additional facilities provided by 
  4238.   Presentation Manager under OS/2 Version 2.0. 
  4239.  
  4240.   This chapter is recommended for application developers with Presentation 
  4241.   Manager applications written for previous versions of OS/2, which they wish 
  4242.   to modify in order to take full advantage of the capabilities of OS/2 Version 
  4243.   2.0. 
  4244.  
  4245.  Mixing 16-Bit and 32-Bit Application Modules describes the way in which 
  4246.   32-bit applications under OS/2 Version 2.0 may make use of existing 16-bit 
  4247.   functions and window procedures, along with restrictions and programming 
  4248.   considerations to be borne in mind when developing such applications. 
  4249.  
  4250.   This chapter is recommended for those programmers working in organizations 
  4251.   with existing 16-bit runtime libraries or DLLs, and who wish to make use of 
  4252.   functions contained within these libraries. 
  4253.  
  4254.  Compiling and Link Editing an Application describes the steps necessary to 
  4255.   compile and link edit a Presentation Manager application under OS/2 Version 
  4256.   2.0, including the use of module definition files.  and the creation of 
  4257.   dynamic link libraries to contain application code and Presentation Manager 
  4258.   resources. 
  4259.  
  4260.   This chapter is recommended for all programmers who will develop Presentation 
  4261.   Manager applications, and who wish to understand how to create executable 
  4262.   modules and dynamic link libraries. 
  4263.  
  4264.  Adding Online Help and Documentation examines the provision of online, 
  4265.   context-sensitive help information for Presentation Manager applications 
  4266.   using the IPF  provided with Presentation Manager, and the use of this 
  4267.   facility to create online documentation. 
  4268.  
  4269.   This chapter is recommended for application developers who wish to provide 
  4270.   online help for their applications, or who wish to develop online 
  4271.   documentation and tutorial programs. 
  4272.  
  4273.  Problem Determination describes some simple techniques for problem 
  4274.   determination and resolution in the Presentation Manager environment, and 
  4275.   discusses some common application problems. 
  4276.  
  4277.   This chapter is recommended for all application developers involved in 
  4278.   testing and debugging Presentation Manager applications. 
  4279.  
  4280.  Generic Application Modules discusses the use of generic routines to perform 
  4281.   commonly used functions within a Presentation Manager application, and 
  4282.   identifies a number of areas where generic functions may be successfully 
  4283.   applied. 
  4284.  
  4285.   This chapter is recommended for planners and development managers who will 
  4286.   manage a number of application developers working on one or more Presentation 
  4287.   Manager applications, and who wish to understand the benefits in terms of 
  4288.   consistency and productivity which can be achieved through the use of common 
  4289.   routines. 
  4290.  
  4291.  Managing Development provides some guidelines for the use of a local area 
  4292.   network (LAN) to facilitate centralized control and administration of the 
  4293.   workstation-based application development process. 
  4294.  
  4295.   This chapter is recommended for planners and development managers who will 
  4296.   manage a number of application developers working on one or more Presentation 
  4297.   Manager applications, and who wish to understand some of the ways in which a 
  4298.   distributed development process may be managed and controlled. 
  4299.  
  4300. The following appendixes are included in this document: 
  4301.  
  4302.  Naming Conventions provides some guidelines for naming conventions to be used 
  4303.   with symbols, subroutines and variables in the Presentation Manager 
  4304.   environment. These guidelines cover the use of Hungarian Notation for such 
  4305.   names. 
  4306.  
  4307.   This chapter is recommended for planners and development managers who wish to 
  4308.   implement a standard series of naming conventions for the application 
  4309.   development projects under their control. 
  4310.  
  4311.  Application Program Construction presents guidelines for the structuring of 
  4312.   applications and their component modules in order to achieve the optimum 
  4313.   level of modularity and granularity within an application, thus promoting 
  4314.   reuse of application code. 
  4315.  
  4316.   This chapter is recommended for planners and development managers who wish to 
  4317.   gain the maximum productivity benefit over a number of Presentation Manager 
  4318.   application development projects. 
  4319.  
  4320.  OS/2 Kernel API Functions compares the operating system kernel functions 
  4321.   provided in OS/2 Version 2.0 with those provided in OS/2 Version 1.3. 
  4322.  
  4323.   This chapter is recommended for programmers who will be migrating 
  4324.   applications from previous versions of OS/2. 
  4325.  
  4326.  Problem Reporting Worksheet provides a worksheet which may be used when 
  4327.   following the steps given in Problem Determination, to provide effective 
  4328.   problem documentation which can then be used to reproduce application errors. 
  4329.  
  4330.   This chapter is recommended for application developers involved in testing 
  4331.   and debugging Presentation Manager applications. 
  4332.  
  4333.  
  4334. ΓòÉΓòÉΓòÉ 10. Related Publications ΓòÉΓòÉΓòÉ
  4335.  
  4336. The following publications are considered particularly suitable for a more 
  4337. detailed discussion of the topics covered in this document. 
  4338.  
  4339. Prerequisite Publications 
  4340.  
  4341.  IBM OS/2 Version 2.0 Application Design Guide, 10G6260 
  4342.  
  4343.  IBM OS/2 Version 2.0 Control Program Reference 
  4344.  
  4345.  IBM OS/2 Version 2.0 Presentation Manager Reference 
  4346.  
  4347.  IBM OS/2 Version 2.0 Programming Tools Reference. 
  4348.  
  4349. Additional Publications 
  4350.  
  4351.  OS/2 Version 2.0 - Volume 1:  Control Program, GG24-3730 
  4352.  
  4353.  OS/2 Version 2.0 - Volume 2:  DOS and Windows Environment, GG24-3731 
  4354.  
  4355.  OS/2 Version 2.0 - Volume 3:  Presentation Manager and Workplace Shell, 
  4356.   GG24-3732 
  4357.  
  4358.  OS/2 Version 2.0 - Volume 5:  Print Subsystem, GG24-3775 
  4359.  
  4360.  OS/2 Version 2.0 Remote Installation and Maintenance, GG24-3780 
  4361.  
  4362.  The Design of OS/2, Harvey M. Deitel and Michael J. Kogan, Addison Wesley 
  4363.   1992 ISBN 0-201-54889-5 (SC25-4005) 
  4364.  
  4365.  Object Oriented Programming:  An Evolutionary Approach, Brad J. Cox, Addison 
  4366.   Wesley 1987 ISBN 0-201-10393-1 
  4367.  
  4368.  Programmer's Guide to the OS/2 Presentation Manager, Michael J. Young, Sybex 
  4369.   1989 ISBN 0-89588-569-7 
  4370.  
  4371.  Programming the OS/2 Presentation Manager, Charles Petzold, Microsoft Press 
  4372.   1989 ISBN 1-55615-170-5 
  4373.  
  4374.  IBM OS/2 Version 2.0 Technical Library - Procedures Language/2 REXX 
  4375.   Reference, 10G-6268 
  4376.  
  4377.  IBM C Set/2 User's Guide, SC09-1310 
  4378.  
  4379.  IBM C Set/2 Migration Guide, SC09-1369 
  4380.  
  4381.  IBM Systems Application Architecture CUA Advanced Guide to User Interface 
  4382.   Design, SC34-4289 
  4383.  
  4384.  IBM Systems Application Architecture CUA Advanced Interface Design Reference, 
  4385.   SC34-4290 
  4386.  
  4387.  IBM Systems Application Architecture Common Programming Interface 
  4388.   Presentation Reference, SC26-4359. 
  4389.  
  4390.  
  4391. ΓòÉΓòÉΓòÉ 11. Overview ΓòÉΓòÉΓòÉ
  4392.  
  4393. IBM* OS/2* Presentation Manager* is a graphical user interface facility that 
  4394. allows the creation of object-oriented, event-driven applications which conform 
  4395. to IBM Systems Application Architecture* (SAA*) Common User Access* (CUA*) 
  4396. guidelines.  Presentation Manager provides an application execution environment 
  4397. under which such applications are executed, and under which they may take full 
  4398. advantage of the advanced capabilities of the OS/2 operating system 
  4399. environment, as well as a system-level mechanism to handle interaction between 
  4400. the application and the user in a consistent and intuitive manner. 
  4401.  
  4402. The object-based Presentation Manager application model facilitates the use of 
  4403. object-oriented software engineering principles such as data abstraction and 
  4404. encapsulation.  The application of these principles enhances application 
  4405. modularity and thereby contributes to increased potential for code reuse and 
  4406. easier application maintenance through containment of change, thereby achieving 
  4407. higher levels of productivity in the areas of application development and 
  4408. maintenance. 
  4409.  
  4410. This document examines the Presentation Manager execution environment in order 
  4411. to describe the structure and implementation of Presentation Manager 
  4412. applications, and to illustrate the facilities provided by Presentation Manager 
  4413. to support object-oriented techniques.  In addition, the document examines the 
  4414. ways in which CUA guidelines may be implemented by Presentation Manager 
  4415. applications within the object-oriented application model.  Particular emphasis 
  4416. is given to the use of software engineering principles which facilitate the 
  4417. creation of reusable code for common application services.  This is one of the 
  4418. primary concerns of the object-oriented approach to application design, and is 
  4419. also one aspect of the Systems Application Architecture  Common Applications 
  4420. ("red layer") component. 
  4421.  
  4422. The document also discusses the management of workstation-based application 
  4423. development projects.  Historically, workstation applications have typically 
  4424. fallen into the systems software category, or have been "one-off" applications 
  4425. and hence have not been subject to the same rules and disciplines imposed upon 
  4426. the traditionally host-based line-of-business applications.  However, as the 
  4427. OS/2 environment begins to provide a viable platform for the implementation of 
  4428. workstation-based and cooperative line-of-business applications, typical 
  4429. corporate investments in workstation software are increasing rapidly, and 
  4430. therefore the management and maintenance of these investments must be 
  4431. considered.  Some suggestions on the management of the workstation-based 
  4432. development process are given in Managing Development. 
  4433.  
  4434.  
  4435. ΓòÉΓòÉΓòÉ 11.1. User Interface ΓòÉΓòÉΓòÉ
  4436.  
  4437. The Presentation Manager user interface model facilitates an intuitive user 
  4438. interface. While people typically approach their work tasks from a 
  4439. "problem-domain" viewpoint, computers tend to adopt an "operator/operand" 
  4440. approach that is inherently alien to the end user.  Traditionally, the required 
  4441. translation between approaches has been left to the user, with applications and 
  4442. their user interfaces written to conform to the computer's viewpoint rather 
  4443. than that of the user.  This approach has often led to users having difficulty 
  4444. relating to the technology, with consequently greater amounts of time and money 
  4445. spent in user training. 
  4446.  
  4447. In recent times, a growing school of thought has emerged which contends that, 
  4448. with the increasing power of computer systems and particularly with the advent 
  4449. of powerful programmable workstations, the responsibility for this interface 
  4450. translation should lie primarily with the application or the computer system 
  4451. rather than with the user.  In order to achieve this, user interfaces must be 
  4452. redesigned in order to operate in an object-action, event-driven manner which 
  4453. corresponds with the users' problem domain viewpoint. 
  4454.  
  4455. Presentation Manager implements such a user interface, and Presentation Manager 
  4456. applications may thus be designed and implemented in such a way as to provide 
  4457. improved user-friendliness and encourage learning by exploration.  The details 
  4458. of the Presentation Manager user interface are described in OS/2 Version 2.0 - 
  4459. Volume 3:  Presentation Manager and Workplace Shell. 
  4460.  
  4461. Presentation Manager also facilitates consistency between applications by 
  4462. handling the interface between user and application at a system level, 
  4463. providing a number of standard constructs which may be exploited by 
  4464. applications. Since these constructs typically appear and behave in the same 
  4465. way regardless of the application under which they are implemented, a user need 
  4466. learn only one set of user interface guidelines to be able to interact with 
  4467. multiple applications.  This consistency reduces confusion for users who work 
  4468. with multiple applications, and reduces the need for extensive application 
  4469. training. 
  4470.  
  4471. The SAA CUA component provides guidelines for the use of these constructs to 
  4472. fulfill particular input/output requirements within an application, such that a 
  4473. level of consistency is achieved not only in the behaviour of the constructs 
  4474. themselves, but also in their relationship to one another and thus in the 
  4475. behaviour of the application as a whole.  These guidelines are documented in 
  4476. the IBM Systems Application Architecture CUA Advanced Guide to User Interface 
  4477. Design. 
  4478.  
  4479.  
  4480. ΓòÉΓòÉΓòÉ 11.2. Object-Oriented Applications ΓòÉΓòÉΓòÉ
  4481.  
  4482. Many definitions of the term object-oriented programming may be found in 
  4483. various publications and presentations appearing over the last few years. 
  4484. These definitions often differ widely, and have resulted in a great deal of 
  4485. confusion and debate as to the "true" meaning of the term. It may be 
  4486. justifiably argued that there is no such true meaning, and the term 
  4487. object-oriented may be used to describe techniques ranging from simple data 
  4488. abstraction to the full inheritance hierarchies implemented by certain 
  4489. object-oriented development tools. 
  4490.  
  4491.  
  4492. ΓòÉΓòÉΓòÉ 11.2.1. Object-Oriented Design ΓòÉΓòÉΓòÉ
  4493.  
  4494. For the purpose of discussion within this document, an object-oriented 
  4495. application will be defined as one where data objects are the focus of the 
  4496. application.  A data object is defined to be a particular representation of a 
  4497. logical data entity.  For example, a document being edited may exist in two 
  4498. places: as an image in memory and as a file on a fixed disk.  Each of these two 
  4499. forms constitutes a separate data object. 
  4500.  
  4501. The procedures that operate upon these data objects in order to carry out 
  4502. application functions are encapsulated with the data objects to form 
  4503. application objects. Application objects are logically independent units 
  4504. comprising both data and function, which communicate with one another to 
  4505. request actions, conveyed in the form of messages passed between the 
  4506. communicating objects.  In object-oriented terminology, the procedures that are 
  4507. invoked to carry out the required actions are known as methods. 
  4508.  
  4509. Several rules apply to the design and behaviour of application objects. These 
  4510. are listed below: 
  4511.  
  4512.  A data object should be accessible only from within a single application 
  4513.   object which "owns" the data object.  The definition, creation and/or 
  4514.   establishment of access to the data object should also be achieved from 
  4515.   within the application object; this is known as the principle of 
  4516.   encapsulation. 
  4517.  
  4518.  The behaviour of and output from an application object should depend upon, 
  4519.   and only upon, the type and contents of the messages it receives. The 
  4520.   behaviour of an object should not depend upon any other external source. 
  4521.  
  4522.   As a corollary to the foregoing principle, the result of passing a particular 
  4523.   type of message may also vary, depending upon the type of application object 
  4524.   to which it is passed, and that object's interpretation of the message. 
  4525.   Adherence to this rule allows the behaviour of an object to differ, depending 
  4526.   upon the nature of the messages received by that object; this differing 
  4527.   behaviour is known as polymorphism. 
  4528.  
  4529. For ease of processing, application objects with similar properties are grouped 
  4530. into object classes. Each object in a class is said to be an instance of that 
  4531. class. Application objects within the same class share properties such as data 
  4532. object definitions, class-specific variable definitions and values, and 
  4533. methods.  Objects therefore take on the properties of their class; this is 
  4534. known as inheritance. 
  4535.  
  4536. It is the concept of inheritance that provides a distinguishing factor between 
  4537. the two major schools of thought which exist under the object-oriented 
  4538. paradigm: 
  4539.  
  4540.  The basic precept of the class-based theory of object-oriented design is that 
  4541.   objects are defined in terms of their class, and that new classes are defined 
  4542.   in terms of existing classes, with certain additions and modifications which 
  4543.   distinguish the new class.  Thus there is a measure of interdependence 
  4544.   between object classes, and an inheritance hierarchy is formed. 
  4545.  
  4546.   The primary advantage of the class-based approach is that it eases the task 
  4547.   of defining object classes, since each new class belongs to a hierarchy of 
  4548.   previously defined classes with their own properties and methods.  The 
  4549.   application developer therefore need only explicitly define the 
  4550.   distinguishing characteristics of each class. 
  4551.  
  4552.   The major disadvatange of the class-based approach is the consequent high 
  4553.   level of interdependence between objects.  Since the unit of modularity is 
  4554.   the entire inheritance hierarchy, rather than the individual object, reuse of 
  4555.   a particular object presupposes reuse of all those objects in its hierarchy 
  4556.   upon which the definition of the required object depends. 
  4557.  
  4558.   The class-based approach therefore provides a high initial productivity to 
  4559.   the application developer, although with a consequent reduction in the level 
  4560.   of granularity and an increase in run-time overhead. 
  4561.  
  4562.  The module-based theory of application development contends that while 
  4563.   objects are defined in terms of their class, each new class is totally 
  4564.   defined in its own right, and is not dependent upon the definitions of other 
  4565.   classes.  Hence there is no inheritance hierarchy under the module-based 
  4566.   approach. 
  4567.  
  4568.   The primary advantage of the module-based approach is that it avoids the 
  4569.   object interdependence associated with the class-based approach, since each 
  4570.   object class contains its own complete definition of properties and methods. 
  4571.   Thus the unit of modularity is the individual application object. 
  4572.  
  4573.   The disadvantage of this approach lies in the fact that the application 
  4574.   developer is required to define each object class in its entirety, and 
  4575.   typically cannot rely on previous definitions. [This may be overcome to some 
  4576.   extent through subclassing, which is explained later in this chapter. ] The 
  4577.   module-based approach therefore attains a higher level of modularity and 
  4578.   independence between application objects, but at the expense of higher 
  4579.   initial development time. 
  4580.  
  4581. The object-oriented approach to application design is most suited to 
  4582. applications where the data is the focus of the application, and is less 
  4583. suitable where the procedure or sequence of actions is the critical factor in 
  4584. the design.  However, in mixed situations where only certain parts of an 
  4585. application or application system are procedurally oriented, as is the case 
  4586. with many work tasks, and where the provision of an event-driven user interface 
  4587. is desirable, the object-oriented paradigm can be extended to encompass 
  4588. procedurally oriented tasks.  This is discussed further in Object-Oriented 
  4589. Applications. 
  4590.  
  4591. While object-oriented applications deal primarily with the manipulation of data 
  4592. entities and their logical representations, there are many situations where an 
  4593. application must deal with other entities such as remote devices or systems. 
  4594. Administrative procedures defined by or imposed upon an organization may also 
  4595. be viewed as logical entities with which an application must interact.  The 
  4596. incorporation of such entities into the object-oriented application paradigm 
  4597. requires an expansion of the concept of an application object to include the 
  4598. definition of and methods pertaining to any type of entity addressed by the 
  4599. application.  This broadened definition is fundamental in making the 
  4600. object-oriented application model applicable to virtually any application 
  4601. scenario. 
  4602.  
  4603.  
  4604. ΓòÉΓòÉΓòÉ 11.2.2. Object-Action Interfaces ΓòÉΓòÉΓòÉ
  4605.  
  4606. For the purpose of discussion within this document, an object-oriented 
  4607. application will also be defined as one that implements an event-driven, 
  4608. object-action user interface such as that specified in the IBM Systems 
  4609. Application Architecture CUA Advanced Guide to User Interface Design.  With 
  4610. such an interface, a user first selects an object to manipulate, then selects 
  4611. one or more of a defined set of actions to be performed upon that object.  The 
  4612. sequence of these actions, and hence the sequence of the dialog with the user, 
  4613. is controlled by the user rather than by the application, where this is 
  4614. possible within the requirements of the work task being performed. 
  4615.  
  4616. The concepts of object-oriented design and an object-action user interface are 
  4617. distinct but complementary.  While it is possible to design and create an 
  4618. object-oriented application without an object-oriented user interface, it it 
  4619. far more difficult to implement a truly event-driven, object-action style of 
  4620. user interface without embracing, at least a certain degree, the 
  4621. object-oriented approach to design and implementation.  It thus follows that 
  4622. the SAA CUA user interface model cannot be fully implemented without some 
  4623. measure of adherence to object-oriented design principles.  It is the provision 
  4624. of an intuitive, event-driven user interface that constitutes one of the great 
  4625. strengths of the object-oriented paradigm. 
  4626.  
  4627.  
  4628. ΓòÉΓòÉΓòÉ 11.2.3. Benefits of the Object-Oriented Approach ΓòÉΓòÉΓòÉ
  4629.  
  4630. A fundamental benefit of an object-oriented approach from the viewpoint of the 
  4631. end user is the ability for an application to behave in a manner that parallels 
  4632. a typical human being's natural approach to problem solving.  The flexibility 
  4633. of the object-action interface allows scope for individual variation in the 
  4634. approach to a particular work task.  However, such a user interface relies upon 
  4635. an object-oriented application implementation in order to allow such 
  4636. flexibility.  Such an implementation is in turn dependent upon the correct 
  4637. design approach, which must begin with a focus upon the entities that affect 
  4638. the application, rather than upon the procedures to be performed upon those 
  4639. entities. 
  4640.  
  4641. The object-oriented paradigm also encourages the concept of data abstraction 
  4642. and encapsulation, whereby the definition of and establishment of access to 
  4643. data objects is achieved from within the application object. Ideally, all 
  4644. access to and manipulation of a data object is carried out from within a single 
  4645. application object, thereby facilitating change management and application 
  4646. maintenance. 
  4647.  
  4648. Another great benefit of the object-oriented approach is the increased 
  4649. potential for creation of reusable code.  The independent nature of application 
  4650. objects enables them to be coupled together in various ways to achieve desired 
  4651. results, with the internal implementation details of each object and its data 
  4652. structures being isolated from the other objects with which it communicates. 
  4653. Applications that manipulate existing data objects may therefore be assembled 
  4654. from a number of existing application objects, thus reducing the time and 
  4655. effort required to develop the application. 
  4656.  
  4657. This potential for object reuse has also given rise to one of the great 
  4658. criticisms levelled at the object-oriented approach; the "myth" of the 
  4659. completely generic object.  Due to the impracticability of foreseeing all 
  4660. possible actions that might be performed on a data object, it is impossible to 
  4661. produce a complete set of methods for that object.  Hence an application object 
  4662. might require modification at some stage in its life cycle, and is not truly 
  4663. reusable. 
  4664.  
  4665. The object-oriented approach overcomes this potential problem by the use of a 
  4666. concept known as subclassing, whereby a new application object is created 
  4667. comprised of a data object and a number of new or modified methods which act 
  4668. upon that object.  Messages destined for the original application object are 
  4669. diverted to the new object;  the original object is said to have been 
  4670. subclassed.  If the message is of a type with which the new object is 
  4671. explicitly concerned, it processes the message using its own methods.  If not, 
  4672. it passes the message on to the original object for processing.  In the 
  4673. subclassing process, neither the sending object nor the original receiving 
  4674. object should be aware that subclassing has taken place.  Subclassing therefore 
  4675. provides a transparent means for modifying or adding to the behaviour of an 
  4676. existing application object without modifying the object itself. 
  4677.  
  4678. The general principles of object-oriented design and programming, as they apply 
  4679. to the Presentation Manager environment, are explored more fully in 
  4680. Object-Oriented Applications. 
  4681.  
  4682.  
  4683. ΓòÉΓòÉΓòÉ 11.3. Presentation Manager Application Model ΓòÉΓòÉΓòÉ
  4684.  
  4685. Contrary to popular belief, Presentation Manager provides far more than merely 
  4686. the ability to achieve a windowed, graphical user interface for the display of 
  4687. information on the screen.  Rather, Presentation Manager provides a 
  4688. message-driven, object-based execution environment that facilitates the 
  4689. provision of an event-driven, object-action user interface, and supports the 
  4690. implementation of object-oriented design techniques. 
  4691.  
  4692. Presentation Manager enables the implementation of an object-action user 
  4693. interface by providing an application programming interface that conforms to 
  4694. the guidelines laid down in the IBM Systems Application Architecture Common 
  4695. Programming Interface Presentation Reference, and a set of underlying system 
  4696. services that support an object-oriented, event-driven application model.  The 
  4697. Presentation Manager programming interface provides user interface constructs 
  4698. which conform to CUA  guidelines.  However, it must be strongly emphasized that 
  4699. the term "presentation interface" is a misnomer, since Presentation Manager is 
  4700. concerned with far more than merely the display of information on the screen. 
  4701.  
  4702. The Presentation Manager application model is centered around the concept of 
  4703. windows. While a window typically appears as a rectangular area on the screen, 
  4704. it is in fact a "handle" to a data object; a window concerned with data being 
  4705. displayed on the screen is termed a display window, whereas a window concerned 
  4706. with an internal data object is known as an object window. Each window belongs 
  4707. to a window class and is associated with a window procedure, which contains the 
  4708. definition of the window's data object(s) and also contains methods to perform 
  4709. all of the processing associated with that window.  Windows and their 
  4710. associated window procedures communicate with the user and with each other, by 
  4711. the use of messages that are routed to the appropriate window by Presentation 
  4712. Manager. 
  4713.  
  4714. Since a window procedure may contain all the processing related to a particular 
  4715. data object, along with the definition of and establishment of access to that 
  4716. data object, Presentation Manager provides a suitable environment for data 
  4717. encapsulation and abstraction, in that the internal representation and workings 
  4718. of a data object may be "hidden" within the window procedure that "owns" the 
  4719. data object.  Provided the external interfaces (that is, the message formats) 
  4720. of the window procedure remain unchanged, other window procedures within an 
  4721. application are insulated from changes to the data object or its processing. 
  4722. This provides a powerful tool for the enhancement of application modularity and 
  4723. the containment of change within an application.  This in turn facilitates the 
  4724. task of application maintenance and change management, since affected 
  4725. application modules may be easily identified. 
  4726.  
  4727. A close corellation may be drawn between the concept of an application object 
  4728. and that of a window under Presentation Manager. The window becomes the 
  4729. identity of, or "handle" to an object; the data referenced by the window 
  4730. (whether a display space on the screen or a data file) becomes a data object; 
  4731. the window procedure associated with a window contains the methods to act upon 
  4732. that data object; and actions to be performed by the application object on its 
  4733. data object are conveyed by way of messages routed to the window by 
  4734. Presentation Manager.  Although Presentation Manager provides window classes to 
  4735. allow grouping of objects with similar characteristics, a full inheritance 
  4736. hierarchy is not supported, and thus Presentation Manager conforms more closely 
  4737. to the module-based theory of object-oriented design than to the class-based 
  4738. approach.  Development tools such as Smalltalk V/PM** are available to extend 
  4739. the Presentation Manager application model and facilitate implementation of a 
  4740. full inheritance hierarchy. 
  4741.  
  4742. The Presentation Manager application model, along with the underlying OS/2 
  4743. environment, affords the ability to store an application object (that is, a 
  4744. data object definition, along with the methods associated with that data 
  4745. object, contained within a window procedure) in a library that may be 
  4746. dynamically linked with an application.  This in turn provides the potential to 
  4747. develop and implement applications composed of one or more generic objects 
  4748. linked by a custom-built application harness, which allows applications to be 
  4749. assembled more quickly and at less cost. 
  4750.  
  4751. The Presentation Manager programming interface includes a mechanism for 
  4752. subclassing a window, whereby messages destined for a particular window may be 
  4753. transparently diverted to another window for specialized processing. 
  4754. Implementing an application using generic objects with subclassing to provide 
  4755. specialized methods may greatly reduce the amount of coding required, and 
  4756. consequently reduce the development time and cost of applications. 
  4757.  
  4758. The general implementation of and support for object-oriented programming 
  4759. principles under Presentation Manager is discussed further in The Presentation 
  4760. Manager Application Model.  The subject is examined in more detail, and 
  4761. specific examples are discussed, in Building a Presentation Manager 
  4762. Application. 
  4763.  
  4764.  
  4765. ΓòÉΓòÉΓòÉ 11.3.1. Systems Application Architecture Conformance ΓòÉΓòÉΓòÉ
  4766.  
  4767. While Presentation Manager supports and facilitates the implementation of 
  4768. object-oriented design techniques and provides support for the user interface 
  4769. constructs and guidelines laid down by the CUA component of Systems Application 
  4770. Architecture, it does not force an application developer to conform to 
  4771. object-oriented design principles or CUA-conforming user interface guidelines. 
  4772. While the rich function set provided by the Presentation Manager programming 
  4773. interface allows an application developer to interpret and implement CUA 
  4774. guidelines in a number of ways, there are emerging conventions with regard to 
  4775. the implementation of these guidelines. 
  4776.  
  4777. In order to achieve the benefits which accrue from adherence to object-oriented 
  4778. and CUA principles, a measure of discipline is required on the part of the 
  4779. application developer, so as to implement the application in such a way that 
  4780. the maximum degree of object-independence and reusability is attained, and that 
  4781. the optimal level of conformance to CUA conventions is achieved.  The subject 
  4782. of CUA conformance is discussed in detail in Systems Application Architecture 
  4783. CUA Considerations. 
  4784.  
  4785. Note that CUA conformance, along with consistency in the implementation of 
  4786. application functions and user interface constructs, may be enforced or 
  4787. enhanced through the use of standard functions and subroutines contained in 
  4788. code libraries.  The creation of such libraries is facilitated by the modular 
  4789. nature of the Presentation Manager environment, and by the dynamic linking 
  4790. capabilities of the OS/2 operating system.  This subject is discussed further 
  4791. in Generic Application Modules. 
  4792.  
  4793.  
  4794. ΓòÉΓòÉΓòÉ 11.3.2. Online Help and Documentation ΓòÉΓòÉΓòÉ
  4795.  
  4796. Presentation Manager also supports the development of online, context-sensitive 
  4797. help panels, along with online documents for support of applications, business 
  4798. processes and computer-based training.  Such information may be displayed in 
  4799. windows on the Presentation Manager desktop, using the Information Presentation 
  4800. Facility (IPF), which is shipped with the operating system. 
  4801.  
  4802. Help panels displayed using IPF are context-sensitive, thereby allowing the 
  4803. user to request help on a specific topic, and the application to that help in a 
  4804. window on the Presentation Manager desktop.  Help panels within an application 
  4805. may be indexed, which allows a user to search for help on related topics in 
  4806. addition to the topic initially requested. 
  4807.  
  4808. Phrases or illustrations within panels may be marked as selectable, and used to 
  4809. display additional information, initiate application events or start new 
  4810. applications.  This capability is provided by the hypertext and hypergraphics 
  4811. facilities of IPF. 
  4812.  
  4813. Online documents may also be generated by IPF.  Such documents are not linked 
  4814. to applications; they act as applications in their own right, and indeed may be 
  4815. used to initiate the execution of application programs using the hypertext 
  4816. facility of IPF.  Online documents may also be indexed, and keyword searches 
  4817. may be conducted on document files; these facilities are part of IPF. 
  4818.  
  4819. Information Presentation Facility is described in detail in Adding Online Help 
  4820. and Documentation. 
  4821.  
  4822.  
  4823. ΓòÉΓòÉΓòÉ 11.4. The Workplace Shell ΓòÉΓòÉΓòÉ
  4824.  
  4825. Under OS/2 Version 1.3, the Presentation Manager provides a basis for the 
  4826. implementation of object-oriented software engineering principles, allowing the 
  4827. developer to take advantage of the benefits inherent in the object-oriented 
  4828. approach. However, the Presentation Manager application model lacks a built-in 
  4829. inheritance hierarchy, and therefore prevents the developer from realizing the 
  4830. productivity and consistency benefits that may be achieved under the principle 
  4831. of inheritance. 
  4832.  
  4833. OS/2 Version 2.0 extends the object-based Presentation Manager user interface 
  4834. with the introduction of the Workplace Shell*, and also provides an 
  4835. object-oriented application model that allows applications to exploit the 
  4836. principle of inheritance. The Workplace Shell application model views an 
  4837. application as a series of objects, typically represented by icons on the 
  4838. Workplace Shell desktop, which are manipulated by the user to achieve the 
  4839. required result. 
  4840.  
  4841. Objects may represent entities such as files, programs or devices, or may be 
  4842. containers that allow the user to logically group related objects.  The 
  4843. properties or contents of an object may be examined using a view of the object, 
  4844. which is typically implemented as a Presentation Manager window. 
  4845.  
  4846. The Workplace Shell application model is based upon the system object model, 
  4847. which defines a set of classes to form a basic inheritance hierarchy, and a set 
  4848. of protocols for interaction between application objects.  The Workplace Shell 
  4849. defines its own object classes that extend the inheritance hierarchy, and an 
  4850. application developer can continue to extend the hierarchy, subclassing 
  4851. existing object classes to create new classes. 
  4852.  
  4853. The Workplace Shell therefore brings both the end user and the application 
  4854. developer closer to the concept of direct object manipulation, and allows 
  4855. exploitation of the class-based theory of object-oriented programming.  The 
  4856. Workplace Shell application model, along with the creation and manipulation of 
  4857. Workplace Shell objects, is described in detail in Workplace Shell and the 
  4858. System Object Model. 
  4859.  
  4860.  
  4861. ΓòÉΓòÉΓòÉ 11.5. Summary ΓòÉΓòÉΓòÉ
  4862.  
  4863. Presentation Manager facilitates the implementation of an event-driven, 
  4864. object-action user interface and provides predefined constructs that enable a 
  4865. consistent, intuitive user interface for multiple applications, in line with 
  4866. the objectives of the Systems Application Architecture Common User Access 
  4867. component.  However, in order to gain the fullest benefit from such an 
  4868. interface, the application developer must adopt a certain degree of 
  4869. object-oriented principles in the design and implementation of applications. 
  4870.  
  4871. In order to support the implementation of an event-driven interface and 
  4872. facilitate the incorporation of object-oriented design techniques, Presentation 
  4873. Manager provides an object-based, event-driven execution environment with an 
  4874. application architecture that conforms closely to object-oriented theory, 
  4875. within the framework of the Systems Application Architecture  Common 
  4876. Programming Interface.  Windows become the handles by which the application 
  4877. references data objects, and windows communicate with one another and with the 
  4878. user in an event-driven manner.  With the addition of the Workplace Shell in 
  4879. OS/2 Version 2.0, the user and the programmer may deal directly with objects 
  4880. and take full advantage of the concept of inheritance. 
  4881.  
  4882. Benefits to be gained from the adoption of such principles include enhanced 
  4883. opportunity for code reuse with consequent reductions in development costs, and 
  4884. easier containment of change through encapsulation and data isolation. As the 
  4885. programmable workstation becomes more widely utilized as the platform for 
  4886. line-of-business applications, the importance of sound software engineering 
  4887. principles in the design and implementation of workstation applications will 
  4888. increase, in accordance with the requirement to be able to adequately manage 
  4889. and maintain these applications.  OS/2 and Presentation Manager together with 
  4890. the Workplace Shell, which extends the paradigm to further exploit 
  4891. object-oriented concepts, provide a platform for the implementation of such 
  4892. principles. 
  4893.  
  4894. It must be emphasized that Presentation Manager provides an application 
  4895. architecture at the operating system level which supports the implementation of 
  4896. certain object-oriented software engineering principles, and provides many of 
  4897. the facilities required by such an approach.  However, while Presentation 
  4898. Manager supports an object-oriented approach to application design, it does not 
  4899. force the application developer to conform to object-oriented design practices. 
  4900. Presentation Manager does not provide, nor does it seek to provide, a complete 
  4901. development environment for object-oriented applications;  the provision of 
  4902. such function is the responsibility of application-enabling products that may 
  4903. reside and execute in the Presentation Manager environment. 
  4904.  
  4905. The remainder of this document will further explore the relationship between 
  4906. OS/2 Version 2.0, Presentation Manager and object-oriented programming, and 
  4907. examine the techniques by which object-oriented applications may be implemented 
  4908. in the Presentation Manager environment, using both the Presentation Manager 
  4909. and Workplace Shell application models. 
  4910.  
  4911.  
  4912. ΓòÉΓòÉΓòÉ 12. Operating System/2 ΓòÉΓòÉΓòÉ
  4913.  
  4914. This chapter briefly explains the differences between the PC DOS and Operating 
  4915. System/2 (hereafter referred to as OS/2) environments, and describes the 
  4916. features and capabilities of IBM OS/2 Version 2.0.  The chapter discusses 
  4917. OS/2's retention of compatibility with existing DOS applications, while 
  4918. providing support for multiprogramming and multitasking, larger memory, 
  4919. multiple concurrent communications, etc. 
  4920.  
  4921.  
  4922. ΓòÉΓòÉΓòÉ 12.1. History ΓòÉΓòÉΓòÉ
  4923.  
  4924. IBM and Microsoft** introduced OS/2 in 1987 as a successor to the PC DOS/MS 
  4925. DOS** operating system [For simplicity, the term "DOS" will be used throughout 
  4926. this document to refer to both the PC DOS and MS DOS products. ] in the 
  4927. programmable workstation environment.  In the years since its inception in the 
  4928. early 1980s, DOS has grown in both capabilities and sophistication, but by 1987 
  4929. advanced workstation users were demanding more sophistication from their 
  4930. applications, to an extent which was beyond the capabilities of DOS to deliver. 
  4931.  
  4932. The choice for operating system developers lay between further enhancing the 
  4933. existing DOS architecture to support more powerful processors, larger memory 
  4934. and so on, or migrating to a new, more powerful operating system architecture 
  4935. which offered more facilities to satisfy user requirements, a broader platform 
  4936. for application development, and potential for future expansion.  The latter 
  4937. choice was taken, and the result was OS/2. 
  4938.  
  4939. The OS/2 operating system environment provides a great deal more power and 
  4940. flexibility than the DOS environment, while maintaining a level of 
  4941. compatibility with existing DOS applications and data.  Enhancements made in 
  4942. OS/2 Version 1.3 include: 
  4943.  
  4944.  Effective use of the advanced capabilities of the Intel 80286 processor 
  4945.  
  4946.  Support for system memory above 640 kilobytes (KB) 
  4947.  
  4948.  Support for multiprogramming and multitasking 
  4949.  
  4950.  Dynamic linking for system and application modules. 
  4951.  
  4952. In addition, numerous other functions are provided to support and complement 
  4953. these capabilities. 
  4954.  
  4955. OS/2 Version 2.0 was developed as an extension of the original 16-bit 
  4956. implementation used in OS/2 Version 1.3, and is an advanced 32-bit multitasking 
  4957. operating system for machines equipped with the Intel 80386** or compatible 
  4958. processors.  The following new features are implemented in OS/2 Version 2.0: 
  4959.  
  4960.  Support for the Intel 80386 32-bit microprocessor instruction set; previous 
  4961.   versions of OS/2 only supported the 80386 in 80286 emulation mode. 
  4962.  
  4963.  32-bit memory management with a flat memory model; previous versions of OS/2 
  4964.   required applications to use the segmented memory model.  See Memory 
  4965.   Management for further information. 
  4966.  
  4967.  Enhanced hardware exploitation. 
  4968.  
  4969.  Support for multiple concurrent DOS applications with pre-emptive 
  4970.   multitasking and full memory protection. 
  4971.  
  4972.  Support for Microsoft Windows** applications. 
  4973.  
  4974.  New 32-bit programming environment. 
  4975.  
  4976.  Binary-level compatibility with previous versions of OS/2, allowing 16-bit 
  4977.   applications written for previous versions to execute under Version 2.0 
  4978.   without modification. 
  4979.  
  4980.  An enhanced Presentation Manager user shell, known as the Workplace Shell, 
  4981.   which implements the 1991 IBM Systems Application Architecture CUA Workplace 
  4982.   Environment. 
  4983.  
  4984. The remainder of this chapter describes the features of OS/2 Version 2.0, and 
  4985. also makes reference to architectural features implemented in previous versions 
  4986. of OS/2 where appropriate. 
  4987.  
  4988.  
  4989. ΓòÉΓòÉΓòÉ 12.2. Intel 80386 32-Bit Microprocessor Support ΓòÉΓòÉΓòÉ
  4990.  
  4991. The basis for OS/2 Version 2.0 is its support for the Intel 80386 
  4992. microprocessor; previous versions of OS/2 were developed for the Intel 80286 
  4993. processor, and supported the 80386 in 80286 emulation mode only. Full support 
  4994. of the 80386 means that a powerful set of 32-bit features now becomes available 
  4995. to the operating system and applications, including enhanced memory management 
  4996. and more sophisticated multitasking capabilities.  The Intel 80386 and 80486 
  4997. offer significant improvements over the previous generation of 16-bit 
  4998. microprocessors, while retaining compatibility with these processors. 
  4999.  
  5000. The memory addressing capacity of the 80386 processor is significantly greater 
  5001. than that of the 80286: 
  5002.  
  5003.  4 gigabyte (GB) physical address space; this compares with the 640 kilobyte 
  5004.   (KB) address space of DOS and the 16 megabyte (MB) address space of OS/2 
  5005.   Version 1.3. 
  5006.  
  5007.  64 terabyte (TB) virtual address space; DOS does not support virtual memory, 
  5008.   and OS/2 Version 1.3 supports 2 GB of virtual memory. 
  5009.  
  5010.  1 byte to 4 gigabyte memory objects; this compares with a 64 KB maximum size 
  5011.   under DOS or OS/2 Version 1.3. 
  5012.  
  5013. OS/2 Version 2.0 uses many of these processor features and capabilities to 
  5014. provide a more powerful and flexible operating system platform.  Note that OS/2 
  5015. Version 2.0 does not implement the full 64 TB virtual address space provided by 
  5016. the 80386, since this requires use of the segmented memory model;  OS/2 Version 
  5017. 2.0 uses a flat memory model, as described in Memory Management. 
  5018.  
  5019.  
  5020. ΓòÉΓòÉΓòÉ 12.3. Memory Management ΓòÉΓòÉΓòÉ
  5021.  
  5022. Memory management is the way in which the operating system allows applications 
  5023. to access the system's memory.  This includes the way in which memory is 
  5024. allocated, either to a single application or to be shared by multiple 
  5025. applications.  The operating system must check the amount of memory available 
  5026. to an application, and must handle the situation where there is insufficient 
  5027. free memory to satisfy an application's requests. 
  5028.  
  5029. Memory management under DOS and OS/2 Version 1.3 was achieved using units of 
  5030. memory known as segments, which could be from 16 bytes to 64 KB in size.  The 
  5031. memory model implemented by these operating systems was therefore known as a 
  5032. segmented memory model. The use of data structures larger than 64KB required 
  5033. the use of multiple segments, the management of which was the responsibility of 
  5034. the application.  This led to increased size and complexity, and reduced 
  5035. performance in applications which handled large data structures. 
  5036.  
  5037. In OS/2 Version 2.0, memory management has been enhanced to provide a flat 
  5038. memory model, which takes advantage of the 32-bit addressing scheme provided by 
  5039. the Intel 80386 architecture.  This means that through memory management, the 
  5040. system's memory is seen as one large linear address space of 4 GB. Applications 
  5041. have access to memory by requesting the allocation of memory objects. Under 
  5042. OS/2 Version 2.0, these memory objects can be of any size between 1 byte and 
  5043. 512 MB.  The use of a flat memory model removes the need for application 
  5044. developers to directly manipulate segments, thereby simplifying application 
  5045. development and removing a significant obstacle in porting applications between 
  5046. OS/2 Version 2.0 and other 32-bit environments such as AIX*. 
  5047.  
  5048. OS/2 Version 2.0 manages memory internally using pages, each of which is 4 KB 
  5049. in size.  Each memory object is regarded by the operating system as a set of 
  5050. one or more pages.  For practical purposes therefore, memory is allocated in 
  5051. units of 4 KB, although a page may be broken down into smaller parts and may 
  5052. contain multiple memory objects. 
  5053.  
  5054. One of the useful aspects of paged memory is the way in which memory 
  5055. overcommitment is handled; that is, what happens when there is no more real 
  5056. memory left to load applications or satisfy a request for memory from an 
  5057. application.  Under OS/2 Version 2.0, individual pages may be swapped to and 
  5058. from disk storage, rather than entire memory objects.  This improves swapping 
  5059. performance, particularly when large memory objects exist in the system. The 
  5060. fixed page size also improves swapping performance since the operating system 
  5061. need not be concerned with moving memory objects about in order to accomodate 
  5062. the various object sizes, as was the case with previous versions of OS/2. 
  5063.  
  5064. For a more detailed discussion of memory management under OS/2 Version 2.0, 
  5065. readers should refer to OS/2 Version 2.0 - Volume 1:  Control Program. 
  5066.  
  5067.  
  5068. ΓòÉΓòÉΓòÉ 12.4. Multiprogramming and Multitasking ΓòÉΓòÉΓòÉ
  5069.  
  5070. A multiprogramming operating system allows the concurrent execution of multiple 
  5071. applications in the same machine.  A multitasking operating system is an 
  5072. extension of the multiprogramming concept, which distributes processor time 
  5073. among multiple applications by giving each application access to the processor 
  5074. for short periods of time.  OS/2 implements both multiprogramming and 
  5075. multitasking. 
  5076.  
  5077. Multitasking may be supported in two forms: 
  5078.  
  5079.  Cooperative multitasking requires the active support of applications running 
  5080.   in the system, which must explicitly relinquish control of the processor to 
  5081.   allow other applications to execute.  This form of multitasking is unreliable 
  5082.   and frequently leads to poor performance, since an ill-behaved application 
  5083.   can monopolize the processor. 
  5084.  
  5085.  Pre-emptive multitasking uses a scheduler as part of the operating system; 
  5086.   the scheduler is responsible for selectively dispatching and suspending 
  5087.   multiple concurrent tasks in the system.  This form of multitasking is more 
  5088.   sophisticated, typically leads to greater overall system throughput, and 
  5089.   allows implementation of priority dispatching schemes for various tasks. 
  5090.  
  5091. Numerous mechanisms exist for providing multiprogramming support under DOS; 
  5092. these include products such as Microsoft Windows.  However, since such 
  5093. facilities are ultimately dependent upon the single-tasking architecture of the 
  5094. DOS operating system, they typically provide only limited multitasking 
  5095. capabilities; where pre-emptive multitasking is supported, schedulers are 
  5096. typically primitive and performance is relatively poor.  Pre-emptive 
  5097. multitasking is not possible during input/output operations, since these 
  5098. operations are performed by the single-tasking DOS operating system. 
  5099.  
  5100. OS/2 provides pre-emptive multitasking under the control of the operating 
  5101. system, which is designed to use the multitasking protected mode of the Intel 
  5102. 80286 and 80386 processors.  OS/2 implements a pre-emptive task scheduler with 
  5103. a multi-level priority scheme, which provides dynamic variation of priority and 
  5104. round-robin dispatching within each priority level.  The dynamic variation of 
  5105. priority is achieved on the basis of current activity, and is intended to 
  5106. improve overall system performance and ensure that the system as a whole 
  5107. responds adequately to user interactions. For circumstances where dynamic 
  5108. variation of priority is inappropriate, the dynamic variation may be disabled 
  5109. using a command in the CONFIG.SYS file, and task priority then becomes 
  5110. absolute.  In either case, task priority may be set and altered dynamically 
  5111. using a number of operating system functions available to OS/2 application 
  5112. programmers. 
  5113.  
  5114. The management of tasks executing in the system is further simplified and 
  5115. streamlined under OS/2 Version 2.0.  This is due primarily to the fact that 
  5116. support for processes executing in real mode (such as the DOS Compatibility Box 
  5117. in OS/2 Version 1.3) is no longer required, since the execution of DOS 
  5118. applications is supported using virtual DOS machines which run as protected 
  5119. mode processes.  See DOS Application Support for further information. 
  5120.  
  5121.  
  5122. ΓòÉΓòÉΓòÉ 12.4.1. Application Support ΓòÉΓòÉΓòÉ
  5123.  
  5124. OS/2 Version 2.0 supports concurrent execution of the following types of 
  5125. applications: 
  5126.  
  5127.  DOS applications, in full-screen mode or in windows on the Presentation 
  5128.   Manager desktop 
  5129.  
  5130.  Microsoft Windows applications, in windows on the Presentation Manager 
  5131.   desktop 
  5132.  
  5133.  16-bit OS/2 applications developed for previous versions of OS/2 
  5134.  
  5135.  New 32-bit applications developed for OS/2 Version 2.0. 
  5136.  
  5137. All applications execute as protected mode processes under OS/2 Version 2.0, 
  5138. and are therefore provided with pre-emptive multitasking and full memory 
  5139. protection; each application is isolated from other applications and from the 
  5140. OS/2 Version 2.0 operating system itself. 
  5141.  
  5142.  
  5143. ΓòÉΓòÉΓòÉ 12.4.2. Processes and Threads ΓòÉΓòÉΓòÉ
  5144.  
  5145. The term task (as in multitasking) refers to a hardware-defined task state. 
  5146. While OS/2 supports multitasking, it does not directly use the concept of a 
  5147. task as defined by the Intel 80386 processor architecture.  Instead, OS/2 makes 
  5148. a differentiation between processes and threads. 
  5149.  
  5150. Processes 
  5151.  
  5152. A process is most easily defined as a program executing in the system. Since it 
  5153. is possible for a single program to be invoked multiple times in a multitasking 
  5154. system such as OS/2, multiple processes may be executing the same program, and 
  5155. each such process is known as an execution instance of the program.  A process 
  5156. owns system resources such as threads, file handles etc, and a memory map that 
  5157. describes the region of memory owned by that process.  Since each process owns 
  5158. its own resources and memory map, which are administered by the operating 
  5159. system on behalf of the process, the resources of one process are protected 
  5160. from access by any other process. In situations where communication between 
  5161. processes is required, OS/2 provides a number of architected mechanisms by 
  5162. which they may be achieved. These mechanisms are described in Interprocess 
  5163. Communication and Synchronization. 
  5164.  
  5165. Threads 
  5166.  
  5167. A thread is the unit of dispatching for the operating system's scheduler, and 
  5168. therefore equates closely with the notion of an 80386 task as defined by the 
  5169. processor architecture.  Each thread is owned by a process, and a single 
  5170. process may have multiple threads.  When a process is created, one thread 
  5171. (known as the primary thread ) is always created to run the code specified in 
  5172. the process creation system call.  Thus a process always has at least one 
  5173. thread.  Secondary threads are often used to perform lengthy operations such as 
  5174. document formatting, remote communications etc, thereby allowing the primary 
  5175. thread to continue interaction with the user. Secondary threads may be created 
  5176. and terminated at any time during execution of a process.  When the primary 
  5177. thread of a process is terminated, the process itself terminates. 
  5178.  
  5179. A thread executes for a short period of time before the operating system's 
  5180. scheduler preempts the thread and gains control.  The scheduler may then 
  5181. determine that there is some other thread that ought to run; if so, the 
  5182. scheduler saves the task state of the current thread and dispatches the new 
  5183. thread, which executes for a period of time until it too is preempted and 
  5184. control returns to the scheduler. 
  5185.  
  5186. OS/2 Version 2.0 supports up to 4096 threads within the system.  Note that this 
  5187. limit includes those threads used by the operating system and by applications 
  5188. executing under operating system control, such as the print spooler.  The 
  5189. number of threads available to applications will therefore be somewhat less 
  5190. than 4096. 
  5191.  
  5192. Since each thread is owned by a process, all threads within that process share 
  5193. the resources and memory map belonging to that process, and thus have access to 
  5194. those resources.  OS/2 does not protect memory resources from being accessed by 
  5195. multiple threads within the same process; this is the responsibility of the 
  5196. application developer.  However, OS/2 provides a number of architected 
  5197. mechanisms to aid the application developer in maintaining the integrity of the 
  5198. application's resources. 
  5199.  
  5200.  
  5201. ΓòÉΓòÉΓòÉ 12.4.3. Interprocess Communication and Synchronization ΓòÉΓòÉΓòÉ
  5202.  
  5203. Since OS/2 provides support for concurrent execution of multiple processes, 
  5204. with memory protection between these processes, it must also provide mechanisms 
  5205. to facilitate synchronization and communication between different processes and 
  5206. threads executing in the system, which may wish to share data and control 
  5207. information.  OS/2 provides a number of such mechanisms, as follows: 
  5208.  
  5209.  Shared memory 
  5210.  
  5211.  Queues 
  5212.  
  5213.  Pipes (both named and anonymous) 
  5214.  
  5215.  Presentation Manager messages 
  5216.  
  5217.  Semaphores. 
  5218.  
  5219. These mechanisms allow application developers to implement applications using 
  5220. multiple processes or threads, while retaining the ability to communicate data 
  5221. and control information in a controlled manner, and to achieve synchronization 
  5222. between various components of an application. 
  5223.  
  5224. Shared Memory 
  5225.  
  5226. The OS/2 memory management architecture utilizes the protect mode of the Intel 
  5227. 80386 processor to achieve memory isolation between processes.  A process has 
  5228. addressability only to its own memory objects.  However, in certain 
  5229. circumstances processes may wish to communicate and pass data to each other; 
  5230. OS/2 allows this by the use of shared memory objects.  Shared memory objects 
  5231. are dynamically requested from the operating system by the application during 
  5232. execution, and are flagged as shareable by OS/2.  It is the responsibility of 
  5233. the applications concerned however, to correctly synchronize the flow of data 
  5234. between processes.  OS/2 provides a number of mechanisms by which this 
  5235. synchronization may be achieved.  Shared memory and its usage is discussed in 
  5236. the IBM OS/2 Version 2.0 Application Design Guide. 
  5237.  
  5238. Queues 
  5239.  
  5240. Queueing system calls are implemented by a system service routine that uses 
  5241. shared memory and semaphores (see below) for serialization.  A queue is created 
  5242. by a process that then becomes the owner of that queue; only the owner may read 
  5243. from the queue.  Other processes may write to the queue, but only the owner may 
  5244. look at elements on the queue, remove elements from the queue, purge or delete 
  5245. the queue.  Queues may be specified with FIFO (first-in, first-out) or LIFO 
  5246. (last-in, first-out) dispatching priority. 
  5247.  
  5248. A queue has a name, similar to a file name, by which it is known to both 
  5249. processes and by which it is referred to when the queue is first accessed by a 
  5250. particular process.  A series of operating system functions is provided by OS/2 
  5251. to create and access queues.  Queues are discussed in detail in the IBM OS/2 
  5252. Version 2.0 Application Design Guide. 
  5253.  
  5254. Pipes 
  5255.  
  5256. A pipe is a FIFO data structure that permits two processes to communicate using 
  5257. file system I/O calls.  The first process writes data into the pipe and the 
  5258. second process reads the data from the pipe.  However, the data is never 
  5259. actually written to an external file, but is held in a shared area in memory. 
  5260.  
  5261. A pipe may be named, in which case it has a name similar to a file name which 
  5262. is known by both processes, or it may be anonymous in which case read and write 
  5263. handles to the pipe are returned by the operating system when the pipe is 
  5264. created.  It is then the responsibility of the creating process to communicate 
  5265. these handles to other threads or processes. 
  5266.  
  5267. The creation of pipes is achieved using a number of OS/2 function calls; once 
  5268. created, pipes are then accessed using file system I/O functions. Pipes and 
  5269. their manipulation are discussed in the IBM OS/2 Version 2.0 Application Design 
  5270. Guide. 
  5271.  
  5272. Presentation Manager Messages 
  5273.  
  5274. In the OS/2 Presentation Manager programming environment, application routines 
  5275. known as window procedures communicate by receiving messages from one another 
  5276. and from Presentation Manager itself.  Messages may be passed between window 
  5277. procedures executing in the same thread, between different threads in a 
  5278. process, or between processes. 
  5279.  
  5280. Messages may be used to pass data between routines executing in different 
  5281. threads or processes, or to communicate events in order to achieve 
  5282. synchronization between threads and/or processes.  Presentation Manager 
  5283. messages may be used to invoke processing routines in either a synchronous or 
  5284. asynchronous manner.  The Presentation Manager messaging model conforms closely 
  5285. to object-oriented programming practices, and is described further in The 
  5286. Presentation Manager Application Model. 
  5287.  
  5288. Atoms 
  5289.  
  5290. Where character strings must be passed between threads, it is relatively simple 
  5291. to pass a pointer to the character string, since all threads within a process 
  5292. share access to memory objects.  Where strings must be passed between processes 
  5293. however, more complex methods such as shared memory must normally be used. 
  5294. OS/2 provides a way to simplify the passing of strings between processes, using 
  5295. atoms. 
  5296.  
  5297. An atom is effectively a "handle" to a string that is stored in an area of 
  5298. shared memory known as an atom table.  Atom tables are maintained by the 
  5299. operating system, and may be private to a particular process or shared by all 
  5300. processes in the system.  OS/2 creates a system atom table at system 
  5301. initialization time, which is accessible by all processes in the system. 
  5302.  
  5303. A process may add a string to an atom table, and obtain an atom that may 
  5304. subsequently be used to access the string.  Atoms that reference strings in the 
  5305. system atom table may be passed between processes using any of the methods 
  5306. described in the foregoing sections, and used by another process to obtain the 
  5307. contents of the string. 
  5308.  
  5309. Semaphores 
  5310.  
  5311. OS/2 applications may be implemented using multiple threads within one or more 
  5312. processes.  Within a single process, the OS/2 memory management architecture 
  5313. provides no memory protection for different threads, and hence multiple threads 
  5314. may have addressability to the same data areas.  It is important that the 
  5315. integrity of resources such as common data areas or files, shared between 
  5316. threads, be protected at all times.  Such resources must be accessed in a 
  5317. serialized fashion.  Although OS/2 provides no automatic protection for data 
  5318. resources between threads within a process, OS/2 allows an application to 
  5319. achieve this serialization of access by using semaphores. 
  5320.  
  5321. A semaphore is a data structure that may be "owned" by only one thread at any 
  5322. time. Semaphores may be used as flags by an application, to indicate that a 
  5323. data resource is being accessed.  A thread may request ownership of the 
  5324. semaphore; if the semaphore is already owned by another thread, the requesting 
  5325. thread is blocked until the first thread releases it. 
  5326.  
  5327. OS/2 Version 2.0 provides a number of different types of semaphores, to be used 
  5328. in different circumstances: 
  5329.  
  5330.  Mutex semaphores provide mutually exclusive access to a particular resource 
  5331.   such as a shared memory object.  These semaphores offer a useful means of 
  5332.   synchronizing access to such resources between different threads or 
  5333.   processes. 
  5334.  
  5335.  Event semaphores are used to signal system or application events. These 
  5336.   semaphores provide a means of signalling events to other threads or 
  5337.   processes, allowing such threads to suspend their execution and "wait" for a 
  5338.   particular event to occur. 
  5339.  
  5340.  MuxWait semaphores may be used when waiting for multiple events to occur or 
  5341.   multiple mutex semaphores to clear. 
  5342.  
  5343. Within these semaphore types, OS/2 Version 2.0 provides both private and shared 
  5344. semaphores.  The system semaphores and RAM semaphores provided by previous 
  5345. versions of OS/2 are also supported, retaining compatibility with applications 
  5346. developed for previous versions of the operating system.  Each process in the 
  5347. system may have up to 65535 private semaphores, and there may be up to 65535 
  5348. shared semaphores in the system. 
  5349.  
  5350. OS/2 Version 2.0 provides a number of operating system functions allowing the 
  5351. creation and manipulation of semaphores.  Semaphores are discussed in the IBM 
  5352. OS/2 Version 2.0 Application Design Guide. 
  5353.  
  5354.  
  5355. ΓòÉΓòÉΓòÉ 12.5. DOS Application Support ΓòÉΓòÉΓòÉ
  5356.  
  5357. OS/2 Version 1.3 provides the capability for a single DOS application to be 
  5358. executed in the system using a facility known as the DOS Compatibility Box. The 
  5359. DOS application executes in real mode, and is automatically suspended if the 
  5360. DOS Compatibility Box is switched to the background; that is, pre-emptive 
  5361. multitasking is not supported in the DOS Compatibility Box under OS/2 Version 
  5362. 1.3. 
  5363.  
  5364. OS/2 Version 2.0 provides the capability to pre-emptively multitask DOS 
  5365. applications along with OS/2 applications, using the Multiple Virtual DOS 
  5366. Machines feature of OS/2 Version 2.0.  The DOS support has been totally 
  5367. rewritten in OS/2 Version 2.0  and allows multiple concurrent DOS applications 
  5368. where each is executed as a single-threaded, protected mode OS/2 program.  This 
  5369. method of implementation provides pre-emptive multitasking for DOS 
  5370. applications, and allows normal OS/2 levels of memory protection; that is, it 
  5371. provides isolation of system memory and other applications, protection from 
  5372. illegal memory accesses by ill-behaved applications, and the ability to 
  5373. terminate sessions where applications are "hung". 
  5374.  
  5375. DOS support is achieved through the use of virtualization techniques, allowing 
  5376. the creation of multiple instances of separate, independent virtual DOS 
  5377. machines. Through this technique, a virtual interface is provided to each DOS 
  5378. machine, giving the impression that each application owns all of the required 
  5379. resources, both hardware and software. 
  5380.  
  5381. Each virtual DOS machine has more memory than the DOS Compatability Box 
  5382. implemented in previous versions of OS/2, and OS/2 Version 2.0 supports the use 
  5383. of Lotus**-Intel-Microsoft (LIM) expanded memory (EMS) and extended memory 
  5384. (XMS) to provide additional memory for those DOS applications that are capable 
  5385. of using such extensions.  OS/2 Version 2.0 maps this extended or expanded 
  5386. memory into the system's normal linear memory address space, and manages it in 
  5387. the same manner as any other allocated memory. 
  5388.  
  5389. The ability of a virtual DOS machine to run within a Presentation Manager 
  5390. window provides immediate productivity gains to existing DOS applications, 
  5391. since they may utilize Presentation Manager desktop features.  These features 
  5392. include window manipulation and the ability to cut/copy/paste information 
  5393. between applications using the clipboard. 
  5394.  
  5395. Application compatibility in the virtual DOS machine is also enhanced over 
  5396. previous versions of OS/2.  The virtual DOS machine can be used to execute 
  5397. DOS-based communications applications and other applications that address 
  5398. hardware I/O devices, through the use of virtual device drivers that map the 
  5399. device driver calls from the applications to the appropriate physical device 
  5400. driver within the operating system.  Applications using hardware devices that 
  5401. are not required to be shared with other applications in the same system may be 
  5402. accessed using the standard DOS device drivers, without the need for a virtual 
  5403. device driver.  Certain restrictions still apply with respect to communications 
  5404. line speed and time-critical interrupt handling. 
  5405.  
  5406. For applications that require specific versions of DOS in order to operate, 
  5407. OS/2 Version 2.0 provides the capability to load a physical copy of that 
  5408. version into a virtual DOS machine.  This provides compatability for those 
  5409. applications that internally manipulate DOS data structures or that use 
  5410. undocumented interfaces. 
  5411.  
  5412. Application compatability in a virtual DOS machine is further enhanced by the 
  5413. DOS settings feature, which allows virtual DOS machines to be customized to 
  5414. suit the requirements of the applications running in them.  Properties such as 
  5415. video characteristics, hardware environment emulation, and the use of memory 
  5416. extenders can all be customized using this feature. 
  5417.  
  5418. Multiple Virtual DOS Machines is described in more detail in OS/2 Version 2.0 - 
  5419. Volume 2:  DOS and Windows Environment. 
  5420.  
  5421.  
  5422. ΓòÉΓòÉΓòÉ 12.6. Microsoft Windows Application Support ΓòÉΓòÉΓòÉ
  5423.  
  5424. OS/2 Version 2.0 provides the capability for Microsoft Windows applications to 
  5425. run under OS/2 Version 2.0, in virtual DOS machines.  This support allows 
  5426. applications written for Windows 3.0 and previous versions of Windows to 
  5427. coexist and execute concurrently in the same machine. 
  5428.  
  5429. Each Windows applications executes as a protected mode process.  Windows 
  5430. applications are therefore subject to the full memory protection facilities 
  5431. provided to protected mode applications under OS/2 Version 2.0, and are 
  5432. protected from one another and from DOS or OS/2 applications executing in the 
  5433. system. This is in contrast to the native Windows 3.0 environment, where 
  5434. limited protection is provided for Windows 3.0 applications, and none at all 
  5435. for DOS applications unless Windows is running in enhanced mode. 
  5436.  
  5437. The execution of Windows applications as protected mode tasks also allows these 
  5438. applications to take full advantage of the pre-emptive multitasking 
  5439. capabilities of OS/2 Version 2.0, with full pre-emptive multitasking between 
  5440. Windows applications, DOS applications and OS/2 applications.  This is again in 
  5441. contrast to the native Windows 3.0 environment, where pre-emptive multitasking 
  5442. is available only for DOS applications, only when Windows 3.0 is running in 
  5443. enhanced mode, and only when no input/output operations are being performed, 
  5444. thereby impacting performance and preventing many applications written for 
  5445. previous versions of Windows from executing. OS/2 Version 2.0 has no such 
  5446. restriction. 
  5447.  
  5448. As with DOS applications, Windows applications may make use of EMS and XMS 
  5449. memory extenders in order to access memory above 640 KB.  This support is 
  5450. provided in an identical manner to that provided for DOS applications. 
  5451.  
  5452. Support for Microsoft Windows applications under OS/2 Version 2.0 is discussed 
  5453. in more detail in OS/2 Version 2.0 - Volume 2:  DOS and Windows Environment. 
  5454.  
  5455.  
  5456. ΓòÉΓòÉΓòÉ 12.7. Dynamic Linking ΓòÉΓòÉΓòÉ
  5457.  
  5458. OS/2 system services are requested by application programs using function 
  5459. calls; the external code references generated by such calls are resolved when 
  5460. the program is loaded or when the segments of the program are loaded, rather 
  5461. than at link-edit time.  This deferred resolution of external references is 
  5462. known as dynamic linking, and is available to applications, which may 
  5463. incorporate their own routines into dynamic link libraries (DLLs). 
  5464.  
  5465. Dynamic linking may be achieved in two ways under OS/2; 
  5466.  
  5467.  Load-time dynamic linking resolves external references within a code segment 
  5468.   at the time the segment is loaded into memory. 
  5469.  
  5470.  Run-time dynamic linking postpones the resolution until the actual execution 
  5471.   of the code, at which time the appropriate module is explicitly loaded and 
  5472.   invoked by the application. 
  5473.  
  5474. Load-time dynamic linking is the simplest mechanism;  as already mentioned, 
  5475. OS/2 system services are implemented in this way.  Load-time dynamic linking is 
  5476. used whenever an application developer wishes to provide common services that 
  5477. may be used by multiple applications, and which are implemented independently 
  5478. of the applications that will use them.  Run-time dynamic linking is used where 
  5479. particular routines may or may not be used by an application, and thus should 
  5480. not be loaded into memory unless required. If an application requires that such 
  5481. a routine be executed, the application may then explicitly load the routine and 
  5482. execute it. 
  5483.  
  5484. Dynamic linking provides an architected method of extending the services of the 
  5485. operating system; all of the application programming interfaces supported by 
  5486. OS/2 are implemented using dynamically linked modules.  An application 
  5487. developer may use the same facilities to create his or her own dynamically 
  5488. linked modules to provide additional services or standard routines that may be 
  5489. used by applications executing in the system. 
  5490.  
  5491. Dynamic linking is of benefit in that routines contained in DLLs are completely 
  5492. independent of application code, and may be modified without the need to 
  5493. re-link applications. In this way, DLLs contribute to the containment of change 
  5494. within applications.  In addition, the contents of DLLs are not limited to 
  5495. application code.  Presentation Manager resources such as icons, bitmaps, 
  5496. graphics fonts, window definitions etc, may be generated and stored in a DLL 
  5497. for subsequent use by applications.  See Presentation Manager Resources for a 
  5498. further discussion of Presentation Manager resources.  DLLs thus provide a 
  5499. powerful mechanism for the creation of reusable modules for both full-screen 
  5500. and Presentation Manager applications. 
  5501.  
  5502. Secondly, the creation of DLLs as re-entrant routines reduces the storage 
  5503. requirements for OS/2 applications, since multiple applications may make use of 
  5504. the same memory-resident copy of a DLL.  This re-entrancy and reusability, in 
  5505. conjunction with the code independence gained by using a DLL, makes the DLL a 
  5506. useful vehicle for implementation of standard service routines, which may be 
  5507. accessed by any application or process within the system.  This contributes to 
  5508. standardization within the business organization, which in turn can result in 
  5509. improved productivity and reduced maintenance effort since the code to 
  5510. implement a particular function need reside in only one location. 
  5511.  
  5512. Note that a DLL is not a process under OS/2.  The re-entrant nature of a DLL 
  5513. allows multiple applications to use the same memory-resident copy of the code; 
  5514. however, each instance executes under the control of the process that invoked 
  5515. it. 
  5516.  
  5517.  
  5518. ΓòÉΓòÉΓòÉ 12.8. Summary ΓòÉΓòÉΓòÉ
  5519.  
  5520. OS/2 provides the programmable workstation platform for the delivery of Systems 
  5521. Application Architecture application functionality in the standalone 
  5522. workstation and cooperative processing environments.  OS/2 overcomes the 
  5523. limitations of the DOS operating system by providing support for large physical 
  5524. and virtual address spaces and supporting concurrent execution of multiple 
  5525. applications with memory isolation and automated task dispatching.  While 
  5526. enforcing memory protection between applications, OS/2 provides architected 
  5527. mechanisms to allow interprocess communication and data sharing in a controlled 
  5528. manner. 
  5529.  
  5530. OS/2 also provides compatibility with existing DOS applications, since OS/2 
  5531. Version 1.3 allows a single DOS application to run using the DOS Compatibility 
  5532. Box, and OS/2 Version 2.0 allows multiple concurrent DOS applications to 
  5533. execute in virtual DOS machines.  OS/2 Version 2.0 also supports Microsoft 
  5534. Windows applications in a similar manner to DOS applications.  This allows 
  5535. users of OS/2 systems to continue to use their existing DOS and Windows 
  5536. applications under the new operating system. 
  5537.  
  5538. OS/2 also implements dynamic linking, which allows an application developer to 
  5539. isolate common application services in separate modules known as dynamic link 
  5540. libraries (DLLs).  Calls to application services provided in a DLL are resolved 
  5541. at execution time, which means that any modifications to the routines contained 
  5542. in a DLL do not require any maintenance to applications using that DLL.  In 
  5543. addition, DLLs are created as re-entrant code, thus allowing multiple 
  5544. applications to use the same memory-resident copy of the DLL code and thereby 
  5545. reducing storage requirements. 
  5546.  
  5547. OS/2 provides an operating system environment for the programmable workstation 
  5548. that enables a far greater degree of functionality and sophistication on the 
  5549. part of application programs.  OS/2 Version 2.0 provides architected methods 
  5550. for overcoming most of the inherent limitations of the DOS and OS/2 Version 1.3 
  5551. environments, and providing the workstation user with a higher level of 
  5552. capability in the workstation.  OS/2 provides the vehicle that will enable the 
  5553. fulfillment of the Systems Application Architecture cooperative processing 
  5554. direction. 
  5555.  
  5556.  
  5557. ΓòÉΓòÉΓòÉ 13. Object-Oriented Applications ΓòÉΓòÉΓòÉ
  5558.  
  5559. This chapter provides a brief overview of some concepts involved in 
  5560. object-oriented application design and programming, and the way in which this 
  5561. approach differs from traditional top-down functional decomposition. It is not 
  5562. intended as an indepth analysis of object-oriented programming, since such a 
  5563. task is beyond the scope of this document, but serves merely to provide a 
  5564. background against which the implementation of object-oriented principles under 
  5565. Presentation Manager may be discussed. 
  5566.  
  5567.  
  5568. ΓòÉΓòÉΓòÉ 13.1. Object-Oriented Concepts ΓòÉΓòÉΓòÉ
  5569.  
  5570. Object-oriented application design places the focus of an application on the 
  5571. logical entities or objects (typically items of data) upon which a program will 
  5572. operate, and attaches procedures or routines to manipulate these objects.  A 
  5573. logical data entity (such as a group of records) may have multiple 
  5574. representations within the system.  Each of these representations is known as a 
  5575. data object, and each data object may have a finite set of actions performed 
  5576. upon it. The data object itself, along with the routines (known as methods) 
  5577. used to perform these actions, are together regarded as an application object. 
  5578.  
  5579. Note that in the remainder of this document, the term data object will be used 
  5580. to denote a particular representation (for example, on the screen or in a disk 
  5581. file) of a logical data entity. The term application object will be used to 
  5582. denote the conjunction of a data object and its methods.  While these terms are 
  5583. not in general use, they will be used here in order to provide a distinction 
  5584. between a data item, and the conjunction of that data item and the routines 
  5585. that act upon it. 
  5586.  
  5587. Application objects typically respond to events, which originate outside the 
  5588. object and which may be system-initiated or user-initiated.  The sequence of 
  5589. these events determines the sequence of operations within the application, and 
  5590. the progression of dialog between the application and the user, rather than the 
  5591. application determining the sequence of the dialog, as is traditionally the 
  5592. case.  Such an object-oriented application environment is thus said to be 
  5593. event-driven. 
  5594.  
  5595. Events are communicated to an application object by means of a series of 
  5596. defined messages, which are not considered to be part of the objects between 
  5597. which they are passed.  The focus of the program thus becomes the object, 
  5598. rather than the procedure, and the program becomes a flow of messages between 
  5599. cooperating objects. 
  5600.  
  5601. Actions on a data object should be possible only by sending messages to the 
  5602. associated application object; an object's methods should not be directly 
  5603. accessible from another object, nor should the behavior of an object be 
  5604. dependent upon any external source other than the messages it receives.  A 
  5605. message should also specify only the action that is to be carried out, and not 
  5606. the way in which it is to be accomplished.  It is the responsibility of the 
  5607. receiving object to determine the way in which to carry out a requested action. 
  5608. Consequently, the behavior of an application object may differ, depending upon 
  5609. the class and content of its input messages.  A corollary of this statement is 
  5610. that the result of passing the same message class may vary, depending on the 
  5611. target object class and its interpretation of that message.  These guidelines 
  5612. outline the concept of polymorphism. 
  5613.  
  5614. One of the primary properties of an application object is its modularity; 
  5615. objects that obey the foregoing rules should be largely independent of one 
  5616. another, and the implementation of one object should not be dependent upon the 
  5617. internal details of another.  Data belonging to an application object should be 
  5618. accessible only by that object;  requests for access by other objects should be 
  5619. made via appropriate messages sent to the application object that "owns" the 
  5620. data object.  Thus the only information necessary to use an application object 
  5621. is a knowledge of the messages it can receive and operate upon (through its 
  5622. methods).  This rule encompasses the principle of encapsulation, which states 
  5623. that a data object should be defined, created and/or accessed solely from 
  5624. within its "owner" application object. 
  5625.  
  5626. Since a number of application objects may exist with similar characteristics, 
  5627. such objects are usually grouped into object classes. A class consists of those 
  5628. objects that share similar properties and methods.  An object class is 
  5629. typically associated with a single data object or type of data object, and has 
  5630. a defined, finite set of methods associated with it.  It is the class that 
  5631. normally defines the messages and methods applicable to an object.  Each object 
  5632. belonging to a particular class is then known as an instance of that class. 
  5633. Each instance inherits data objects and values defined for its class, and may 
  5634. also contain its own data, known as instance data; the properties of instance 
  5635. data are typically obtained from the definition of the object class, but the 
  5636. values are defined uniquely by each instance. 
  5637.  
  5638. The object-oriented approach is most suited to situations where the purpose of 
  5639. the application is the manipulation of data, whether on the screen or in a data 
  5640. file, and where the exact sequence of actions is not critical, provided all 
  5641. necessary actions are carried out.  The focus of an object-oriented application 
  5642. is the data objects that are being manipulated; the functions to be performed 
  5643. are subordinate to the data objects upon which they will act. In addition, the 
  5644. event-driven user interface places the user in control of the sequence of 
  5645. actions, and provides flexibility with respect to the way in which the desired 
  5646. result is achieved. 
  5647.  
  5648. An advantage of the object-oriented design approach for data manipulation 
  5649. applications is that a particular data object is "owned" by one application 
  5650. object, and that the definition of and establishment of access to that data 
  5651. object is achieved from within the application object.  Since application 
  5652. objects may be made relatively independent of one another, other objects may be 
  5653. isolated from changes to the data structure.  This greatly simplifies 
  5654. application maintenance, since all necessary changes need only be made within a 
  5655. single object. 
  5656.  
  5657. Note that since application objects are closely related only to their 
  5658. associated data objects, and not to the applications from which they are 
  5659. accessed, it follows that application objects may be constructed for each data 
  5660. object, and accessed from multiple applications.  An application need not be 
  5661. aware of the internal workings of an application object, but need only know the 
  5662. correct type and format of the messages through which to interact with the 
  5663. object.  Thus the object-oriented approach facilitates code reusability. 
  5664.  
  5665.  
  5666. ΓòÉΓòÉΓòÉ 13.1.1. Object-Oriented vs Functional Decomposition ΓòÉΓòÉΓòÉ
  5667.  
  5668. Under a traditional functional decomposition approach to program design, often 
  5669. referred to as structured programming, the function or procedure is the unit of 
  5670. modularity; programs are designed and implemented by placing a number of 
  5671. well-defined procedures in a particular order, and executing these procedures 
  5672. to achieve a desired result.  The focus of the design is the procedure or 
  5673. action to be performed.  Objects such as data structures are attached to 
  5674. procedures and passed between them using parameters.  A user typically selects 
  5675. an action to be performed, and then selects or enters a data object upon which 
  5676. to perform that action. 
  5677.  
  5678. Figure "Program Flow - Functional Decomposition Approach" 
  5679.  
  5680. The functional decomposition approach is best suited to situations where the 
  5681. procedure is necessarily the focus of the application (for instance, a process 
  5682. management application), and where the correct sequencing of operations to be 
  5683. performed is a crucial factor in the successful execution of the required task. 
  5684. Under this approach, the application defines the sequence of actions which the 
  5685. user performs;  that is, the application controls the user interface. 
  5686.  
  5687. In an object-oriented approach, the application object is the unit of 
  5688. modularity.  Application objects communicate with each other and pass messages 
  5689. containing actions to be performed.  Object-oriented programming is hence the 
  5690. conceptual inverse of functional decomposition, and is a logical extension of 
  5691. the industry trend toward data-centric application design. 
  5692.  
  5693. Figure "Program Flow - Object-Oriented Approach" 
  5694.  
  5695. This is not to say that an object-oriented application should not be 
  5696. structured.  Although such an application consists of objects that are largely 
  5697. independent of one another in programming terms, normal structured coding 
  5698. techniques should be followed in the creation of the methods within each 
  5699. application object. 
  5700.  
  5701. The object-oriented approach also requires firm management of the application 
  5702. development process in order to achieve the greatest possible level of 
  5703. productivity through code reuse.  Administration and control of existing 
  5704. objects is vital in order to allow application developers to access and use 
  5705. these objects in their applications.  Management of the application development 
  5706. process is discussed in greater detail in Managing Development, and the 
  5707. structuring of application source modules in order to provide optimal 
  5708. granularity is described in Application Program Construction. 
  5709.  
  5710. While it is possible for an application designed according to functional 
  5711. decomposition principles to implement some of the characteristics of 
  5712. object-oriented applications such as message passing, such applications should 
  5713. not be regarded as truly object-oriented.  If the design approach centers on 
  5714. procedures rather than data objects, then the application is designed along 
  5715. functional decomposition guidelines.  In this case, message passing is merely a 
  5716. replacement of the normal subroutine call mechanism, and does not significantly 
  5717. affect the structure of the application. 
  5718.  
  5719.  
  5720. ΓòÉΓòÉΓòÉ 13.1.2. Class-Based vs Module-Based ΓòÉΓòÉΓòÉ
  5721.  
  5722. The notion of object classes, and the extent to which this concept is taken, 
  5723. provides the distinguishing factor between two primary schools of thought 
  5724. within the object-oriented paradigm.  Under a class-based approach, objects are 
  5725. defined in terms of their class, and each class is defined in terms of other 
  5726. previously defined classes, the properties and methods of which are 
  5727. automatically conveyed upon the new class;  this is known as the principle of 
  5728. inheritance. 
  5729.  
  5730. For example, the object class "horse" may be defined as a sub-class of the 
  5731. object class "quadruped", with the additional properties of being able to be 
  5732. ridden and eating grass.  A further object class "pony" may then be defined as 
  5733. being a sub-class of the class "horse", with an additional upper limit on size. 
  5734. While this is a somewhat frivolous example, it illustrates the principle that 
  5735. an object class is defined in terms of other object classes, and need only 
  5736. explicitly define those properties and methods that are unique to that object 
  5737. class.  All other properties and methods are inherited from its parent class or 
  5738. classes.  This introduces the concept of an inheritance hierarchy, in that an 
  5739. object inherits not only the properties and methods of its class, but also 
  5740. those of other classes by way of which that class was defined. 
  5741.  
  5742. The major advantage of such an inheritance hierarchy is that, given a 
  5743. well-documented set of existing objects, it becomes extremely easy to create 
  5744. new object classes, simply by defining the new class in terms of other classes 
  5745. that already exist, and simply specifying any new or different properties or 
  5746. methods that apply to the new class.  This of course assumes the use of 
  5747. adequate object documentation and management practices.  Without such 
  5748. practices, it becomes difficult if not impossible to identify a suitable base 
  5749. object from a large library of existing object classes. 
  5750.  
  5751. However, many existing implementations of the class-based approach extend the 
  5752. inheritance hierarchy to a great degree, such that almost all imaginable object 
  5753. classes are defined in terms of parent object classes. While this provides a 
  5754. unified approach to the problem of object definition, the significant 
  5755. disadvantage of such an approach is the increased level of interdependence 
  5756. between objects.  The unit of modularity becomes the complete hierarchy rather 
  5757. than the individual object, since an object has no complete definition in its 
  5758. own right.  The reuse of a single object therefore requires the inclusion of 
  5759. its complete parent hierarchy.  Since it is typical for this parent hierarchy 
  5760. to be defined dynamically using run-time definitions for parent classes rather 
  5761. than defined statically at application generation, it is also possible for 
  5762. changes to a parent class to cause unforeseen side-effects in the behavior of 
  5763. descendant object classes.  Thus inheritance hierarchies require careful 
  5764. management to ensure that such side effects do not occur and adversely affect 
  5765. the integrity of applications and data. 
  5766.  
  5767. Where the inheritance hierarchy is taken to the extent of providing 
  5768. system-defined object classes, to which all application-defined object classes 
  5769. are linked, the hierarchy and thus the application is dependent upon the 
  5770. existence of a virtual machine conceptual environment, which must also be 
  5771. accepted along with the hierarchy.  This in turn may result in significant 
  5772. penalties in terms of application efficiency and run-time performance. 
  5773.  
  5774. A module-based approach to object-oriented programming defines each object as 
  5775. complete in its own right.  Objects may still be grouped into classes for 
  5776. easier definition and processing, but each class possesses its own complete set 
  5777. of properties and methods, and is not dependent upon another class for a part 
  5778. of this definition.  The primary advantage of the module-based approach is the 
  5779. increased level of independence between objects, with a finer degree of 
  5780. granularity in the application allowing object reuse with a lower level of 
  5781. overhead.  The main disadvantage of this approach is that each object class 
  5782. must be completely defined, requiring more work on the part of the application 
  5783. developer at the time the object is created. 
  5784.  
  5785. The concept of inheritance, while providing great potential for productivity 
  5786. enhancement during the application development process, must be carefully 
  5787. managed in order to avoid additional complications in application management 
  5788. and maintenance due to object interdependencies.  Side effects arising from 
  5789. modification to parent object classes may adversely affect the integrity of an 
  5790. application.  The alternative course of action, that of prohibiting the 
  5791. modification of existing objects in favor of creating new objects that inherit 
  5792. only the unmodified properties of the existing object, is often not viable due 
  5793. to the increased application overhead and managerial effort required to 
  5794. maintain and control an ever-expanding inheritance hierarchy. Reliance on the 
  5795. behavior of existing objects must therefore be viewed with extreme caution in 
  5796. the absence of effective management controls over object modification. 
  5797.  
  5798. The increase in development productivity provided by the use of inheritance may 
  5799. often be offset by the increased time and effort spent in regression testing of 
  5800. existing applications in order to determine any effects on these applications 
  5801. caused by the modification of existing object classes.  Tight managerial 
  5802. controls over development must therefore be maintained in order to identify and 
  5803. isolate those existing object classes that are modified and which are likely to 
  5804. affect existing applications. 
  5805.  
  5806. One technique that can be used to minimize the impact on existing applications 
  5807. is for the development organization to adopt a standard whereby, once an 
  5808. application object is deployed in a production environment, new applications 
  5809. that use the object may only modify its behavior through the use of subclassing 
  5810. (see Subclassing).  This means that the object itself is not modified, and 
  5811. other applications that use the object are not affected. 
  5812.  
  5813.  
  5814. ΓòÉΓòÉΓòÉ 13.1.3. Subclassing ΓòÉΓòÉΓòÉ
  5815.  
  5816. As already mentioned, the object-oriented approach facilitates the reuse of 
  5817. application code; generic objects may be created and used by multiple 
  5818. applications to perform actions upon the same data object or type of object. 
  5819. However, one of the criticisms often levelled at this capability is that it 
  5820. becomes impossible to foretell the total set of actions that may ever be 
  5821. required with respect to a particular data object, and that an object is 
  5822. therefore never truly reusable. 
  5823.  
  5824. The object-oriented approach overcomes this difficulty by providing a way for 
  5825. applications to modify the behavior of existing application objects without 
  5826. modifying the objects themselves; this is known as subclassing the object. A 
  5827. subclass application object is composed of a data object definition and a 
  5828. certain number of methods to manipulate that object.  The subclass application 
  5829. object may contain methods that are not contained within the original 
  5830. application object created for that data object, or methods that are modified 
  5831. in some way from those contained in the original object.  In this way a 
  5832. subclass application object may add new methods to perform actions which are 
  5833. not performed by the original object class, or to handle certain types of 
  5834. message in a different way than that normally carried out by the original 
  5835. object class. 
  5836.  
  5837. Figure "Subclassing an Application Object" 
  5838.  
  5839. When an application object has been subclassed, all messages intended for that 
  5840. object are directed to the subclass application object first.  The sending 
  5841. object need not be aware that the message has been diverted.  If the subclass 
  5842. application object does not contain a method to deal with a particular message, 
  5843. it should then pass the message on to the original application object, for 
  5844. processing by one of that object's methods.  The original application object 
  5845. receiving a message in this way should also be unaware that it has been 
  5846. subclassed. 
  5847.  
  5848. A useful application of the subclassing principle occurs when a generic 
  5849. application object is defined and stored away for use by many applications, 
  5850. taking advantage of the reusability aspects of the object-oriented approach. 
  5851. Where one application wishes to perform a particular action in a slightly 
  5852. different manner than that performed by the methods associated with the generic 
  5853. object, a subclass application object may be created containing a new method 
  5854. for that specific action only, and passing all other messages to the original 
  5855. application object for regular processing.  It can be seen that subclassing is 
  5856. a technique for application of the concept of inheritance, through its ability 
  5857. to transparently add properties and methods to existing objects. 
  5858.  
  5859. Subclassing also provides a way to overcome the danger of inadvertently 
  5860. impacting the behavior of other applications by modifying an existing 
  5861. application object.  If a standard is adopted whereby existing application 
  5862. objects in a production environment may only be modified through subclassing, 
  5863. such changes do not impact applications using the original object or which may 
  5864. themselves have subclassed that object.  In this way the need for regression 
  5865. testing of affected applications is eliminated, and the degree of 
  5866. object-management required is significantly reduced. 
  5867.  
  5868. When a functional requirement may be satisfied by modifying the methods of an 
  5869. existing application object (through subclassing), a decision must be made 
  5870. regarding the relative merits of modifying the object, against creating a new 
  5871. object.  Various texts advocate a rule whereby a new object should be created 
  5872. when more than 10% or 20% of an existing object's methods must be modified. 
  5873. However, the decision of whether to modify an existing object or create a new 
  5874. object must be taken on the basis of object complexity, degree of modification 
  5875. and experience. 
  5876.  
  5877.  
  5878. ΓòÉΓòÉΓòÉ 13.2. User View vs Application View ΓòÉΓòÉΓòÉ
  5879.  
  5880. A primary benefit of the object-oriented approach is its intuitive user 
  5881. interface; a user selects an object and performs a series of predefined actions 
  5882. upon that object.  This object-action style of interface encourages the user to 
  5883. explore the application through context-sensitive actions, and reduces the 
  5884. overall complexity of the user's interaction by reducing the levels of 
  5885. hierarchy required for the application. 
  5886.  
  5887. However, the end user may have a different view of an object-oriented 
  5888. application from that which must necessarily be taken by the application 
  5889. developer.  For instance, in the case of a text editor application editing a 
  5890. file, there may in fact be two versions of this file; one existing in memory, 
  5891. being manipulated by the application, and the other stored on a disk.  The 
  5892. application would consider these as two separate data objects, each with its 
  5893. own set of methods, and would create two application objects. 
  5894.  
  5895. Normal user interaction would take place with one object (the memory 
  5896. representation of the file), and when the user selects a "Save" action for the 
  5897. file, a message is passed to the second object (the disk representation of the 
  5898. file) with the information necessary to save updates on disk storage.  The user 
  5899. considers the logical data entity as the object being manipulated, while the 
  5900. application must distinguish between the representations of that data entity in 
  5901. various locations within the system. The user's metaphorical view of the data 
  5902. object is therefore not carried over to the application's view, which must by 
  5903. necessity be more concerned with the reality of that object's manipulation. 
  5904.  
  5905. Note however, that this distinction between representations should not be 
  5906. apparent to the end user.  The end user should perceive a single object (the 
  5907. text file) upon which he or she would perform actions.  Thus there is a 
  5908. distinction between the user's view and the application's view of the objects. 
  5909. An understanding of this distinction is important in order to comprehend the 
  5910. difference between an object-action user interface and an object-oriented 
  5911. application design. 
  5912.  
  5913. Figure "Object-Oriented Development Progression" 
  5914.  
  5915. The two concepts are complementary but distinct.  An event-driven, 
  5916. object-action user interface necessarily emerges from an object-oriented 
  5917. application design and implementation.  It is not possible to provide such an 
  5918. interface unless the application structure conforms to a certain level of 
  5919. object-oriented principles and practices.  This in turn is dependent upon an 
  5920. object-oriented application design.  For this reason, the proper implementation 
  5921. of the graphical user interface concepts defined in the IBM Systems Application 
  5922. Architecture CUA Advanced Guide to User Interface Design, requires applications 
  5923. to be designed and implemented using object-oriented guidelines. 
  5924.  
  5925.  
  5926. ΓòÉΓòÉΓòÉ 13.3. Object-Oriented Design ΓòÉΓòÉΓòÉ
  5927.  
  5928. The success of object-oriented design lies in the correct and intelligent 
  5929. definition of application objects and their methods as coherent and independent 
  5930. units.  The secret of a successful approach to this task is the consideration 
  5931. of the data objects themselves as the focus, rather than the procedures that 
  5932. will operate upon these objects.  Since the objects are typically associated 
  5933. with data, an entity-relationship model is often a useful starting point. 
  5934.  
  5935. Correctly-designed application objects facilitate reusability, since the data 
  5936. object and applicable actions are all defined within the application object. 
  5937. Additional applications that require manipulation of that data object may use 
  5938. the existing application object to achieve the required actions.  Certain 
  5939. applications may require additional, unforeseen actions, or that existing 
  5940. actions be carried out in a different manner; in such cases, subclassing the 
  5941. application object allows such modifications to be carried out.  One of the 
  5942. aims in the high-level design of an object-oriented application should be to 
  5943. make maximum use of existing application objects where possible, in order to 
  5944. reduce the design, coding and testing effort required.  This not only reduces 
  5945. the time and expense involved in application development, but enables 
  5946. application solutions to be delivered in a shorter time frame, allowing the 
  5947. business enterprise to respond more quickly to a dynamic marketplace. 
  5948.  
  5949. The correct definition of application objects and their boundaries also 
  5950. facilitates change management and maintenance of application code, since 
  5951. changes to a particular data object should affect only the application 
  5952. object(s) dealing with that data object.  Thus the effects of change are 
  5953. ideally confined to a single application object.  Modifications to a method 
  5954. within an application object should not affect the workings of other objects 
  5955. with which that application object interacts, provided the external interfaces 
  5956. of that object are not altered by the modification.  This containment of change 
  5957. within a single application object has the potential, in conjunction with 
  5958. proper configuration management techniques, to greatly ease the effort and cost 
  5959. involved in application maintenance. 
  5960.  
  5961. The following steps are necessary in the design of an object-oriented 
  5962. application: 
  5963.  
  5964.  1. Identify the data objects (that is, the different representations of the 
  5965.     logical data entity or entities upon which the application is to operate) 
  5966.     and the relationships between data objects. 
  5967.  
  5968.  2. Determine the set of applicable actions to be performed on each data 
  5969.     object. 
  5970.  
  5971.  3. Determine whether application objects have been previously been created for 
  5972.     the data objects to be manipulated by the application, and to what extent 
  5973.     these existing objects perform the required set of actions for each object. 
  5974.  
  5975.  4. Determine the message classes required to achieve the desired communication 
  5976.     and to initiate required actions that are not already satisfied through 
  5977.     existing application objects. 
  5978.  
  5979.  5. Design the methods necessary to carry out the additional actions. 
  5980.  
  5981. These steps are generic in nature, and must be combined with suitable 
  5982. management controls, checkpoints and documentation standards to ensure adequate 
  5983. design quality at each stage in the process. 
  5984.  
  5985.  
  5986. ΓòÉΓòÉΓòÉ 13.3.1. Object Identification ΓòÉΓòÉΓòÉ
  5987.  
  5988. The identification of data objects and their relationships should begin with 
  5989. the definition of a normal entity-relationship model, and the extension of this 
  5990. model to reflect the representations of data objects as well as the logical 
  5991. data entities involved.  The objective should be to achieve an optimal balance 
  5992. between the number of object classes and the size and complexity of each class, 
  5993. since each object may itself be composed of other objects, also bearing in mind 
  5994. that multiple objects of the same class may exist.  Optimizing the number of 
  5995. object classes will allow the number of message classes to be minimized, which 
  5996. in turn simplifies the design of the methods and the eventual testing of the 
  5997. object classes. 
  5998.  
  5999.  
  6000. ΓòÉΓòÉΓòÉ 13.3.2. Action Identification ΓòÉΓòÉΓòÉ
  6001.  
  6002. Having defined the data objects and their relationships, the set of actions 
  6003. pertaining to each data object should be determined. Once this point is 
  6004. achieved, the high-level design of the application objects, and therefore of 
  6005. the application itself, is essentially complete, and should be documented and 
  6006. approved by all concerned parties before the detailed design of methods 
  6007. commences.  Note that it is not necessary to define all of the applicable 
  6008. actions for each data object, since the essentially independent nature of 
  6009. methods allows additional actions to be added to an application object. 
  6010.  
  6011.  
  6012. ΓòÉΓòÉΓòÉ 13.3.3. Search for Existing Objects ΓòÉΓòÉΓòÉ
  6013.  
  6014. Once the data objects and the set of actions required for each object have been 
  6015. defined, the application designer should determine the existence of any 
  6016. previously-created application object classes for that type of data object. 
  6017. The use of existing application objects, with additional actions and methods 
  6018. handled through subclassing, can significantly reduce the amount of coding 
  6019. required. 
  6020.  
  6021. The accurate identification of existing application object classes requires 
  6022. that each application object, upon completing its final testing, must be placed 
  6023. in an object library, and its external interfaces (both input and output) must 
  6024. be fully documented and placed in a retrieval system from which the object's 
  6025. description may be recalled by designers of future applications.  The 
  6026. organization and level of sophistication of such a system is largely at the 
  6027. discretion of the development organization, but becomes more crucial as the 
  6028. number of application objects grows larger over time.  It is strongly 
  6029. recommended that any organization embarking on a strategy of object-oriented 
  6030. application development should adopt an efficient object library management 
  6031. system from the outset. 
  6032.  
  6033.  
  6034. ΓòÉΓòÉΓòÉ 13.3.4. Message Definition ΓòÉΓòÉΓòÉ
  6035.  
  6036. When the high-level design is complete, the message classes and their contents 
  6037. must be defined for each action that will be performed on and by an object. 
  6038. Note also that the same message class may be used with different object classes 
  6039. to achieve a different result, in accordance with the principle of 
  6040. polymorphism, thus reducing the number of defined message classes and 
  6041. simplifying the design of the application objects and their methods. 
  6042.  
  6043. The message classes comprise the interfaces between objects, and provide the 
  6044. input and output for the methods associated with the object.  These message 
  6045. interfaces must therefore be documented to facilitate reusability of the 
  6046. newly-created application objects by documenting the valid inputs and outputs 
  6047. for each object class, and the behavior of the object in response to these 
  6048. messages. 
  6049.  
  6050. Since the messages received and dispatched by an object constitute the inputs 
  6051. and outputs required and expected of that object, the documented message 
  6052. interfaces provide a valuable starting point for developing a test plan for the 
  6053. object.  Since the inputs, actions and outputs are known, a comprehensive set 
  6054. of test data may then be formulated to test the methods associated with each 
  6055. action, with both valid and invalid message inputs. 
  6056.  
  6057.  
  6058. ΓòÉΓòÉΓòÉ 13.3.5. Method Design ΓòÉΓòÉΓòÉ
  6059.  
  6060. Traditional functional decomposition techniques may then be used in the design 
  6061. of the methods to complete the required actions.  If the high-level design has 
  6062. been completed correctly, the application objects should be relatively 
  6063. independent of one another. It should therefore be possible to complete the 
  6064. development and testing of the methods for each object class as a separate task 
  6065. with each class, its methods and valid interfaces defined and unit-tested 
  6066. before the application is brought together for final integration-testing. 
  6067.  
  6068.  
  6069. ΓòÉΓòÉΓòÉ 13.4. Object-Oriented Implementations ΓòÉΓòÉΓòÉ
  6070.  
  6071. There has been much discussion in the computing industry press concerning 
  6072. application development products and tools that support the creation of 
  6073. object-oriented applications.  While the use of such products is a valuable aid 
  6074. in designing and developing an object-oriented application, it should not be 
  6075. construed that their use is essential to the successful implementation of an 
  6076. object-oriented approach. 
  6077.  
  6078. It is quite possible to implement module-based object-oriented principles to a 
  6079. practical and beneficial degree in the Presentation Manager environment, using 
  6080. a "conventional" programming language such as "C".  However, the degree of 
  6081. discipline and amount of work required of the application developer is greater 
  6082. when a standard programming language is used.  Object-oriented tools or 
  6083. language extensions make the task of the application developer much easier, 
  6084. since many of the object-oriented concepts are handled by the tools themselves, 
  6085. without the need for the developer to concern him/herself with the details of 
  6086. their implementation. 
  6087.  
  6088. Object-oriented programming tools fall into two general categories: 
  6089.  
  6090.  Those that provide extensions to an existing programming language and 
  6091.   implement certain object-oriented conventions, such as C++. These languages 
  6092.   typically provide object-oriented constructs but do not force an application 
  6093.   developer into the use of such constructs.  The strength of such 
  6094.   implementations is their flexibility, but they have the inherent weakness 
  6095.   that it is easy to develop application code that does not conform to 
  6096.   object-oriented programming practices. 
  6097.  
  6098.  Those that provide a complete programming language syntax, which obeys and 
  6099.   implements object-oriented principles, such as Smalltalk V**. These languages 
  6100.   provide an additional benefit in that they force the application developer 
  6101.   into obeying object-oriented programming practices, but at the expense of 
  6102.   flexibility. 
  6103.  
  6104. The tools that are marketed as "object-oriented" and which are currently 
  6105. available in the marketplace tend to implement the class-based approach to 
  6106. object-oriented programming.  Their primary benefit is thus that they provide 
  6107. an inheritance hierarchy, and so make the task of object creation much easier 
  6108. for the application developer, albeit at the risk of reduced code efficiency 
  6109. and possible dependence upon a conceptual run-time environment. 
  6110.  
  6111. The choice of an object-oriented programming tool is very much an individual 
  6112. one, and depends on the requirements and priorities of the development 
  6113. organization, the skills and prior experience of the application developers 
  6114. concerned, and the degree to which object-oriented practices are to be enforced 
  6115. within the organization. 
  6116.  
  6117.  
  6118. ΓòÉΓòÉΓòÉ 13.5. More Complex Objects ΓòÉΓòÉΓòÉ
  6119.  
  6120. For relatively simple applications where a data object is retrieved, 
  6121. manipulated and saved again, the foregoing definition of an application object 
  6122. will suffice.  However, the situation often arises when an application must 
  6123. perform some processing that is rather more complicated. Either the application 
  6124. must interface with another system or external device or a certain work task 
  6125. must be performed in a particular sequence of operations that is critical to 
  6126. the correct completion of the task.  The incorporation of such requirements 
  6127. into the object-oriented paradigm requires an expansion of the application 
  6128. object concept. 
  6129.  
  6130. The key to successful expansion of the object-oriented paradigm lies in the 
  6131. definition of a data object. Whereas a data object was previously defined as a 
  6132. manifestation of a logical data entity, the definition will now be expanded to 
  6133. include any other type of logical entity or source of information, such as an 
  6134. external system or a procedures manual. 
  6135.  
  6136.  
  6137. ΓòÉΓòÉΓòÉ 13.5.1. Device Manipulation ΓòÉΓòÉΓòÉ
  6138.  
  6139. The entity represented by an application object may be a physical device. For 
  6140. example, suppose an application is required to access a particular type of 
  6141. external data input device such as an MICR reader.  The definition of the 
  6142. protocols and specialized access routines necessary to interact with such a 
  6143. device can be encapsulated within an application object, and the various 
  6144. actions performed by the device on behalf of the application (such as getting 
  6145. the next MICR document) then become the methods associated with that object. 
  6146. The application thus regards the MICR reader as an object to which it passes 
  6147. messages in order to perform actions; the results of those actions are then 
  6148. conveyed back to the application, also by way of messages. 
  6149.  
  6150.  
  6151. ΓòÉΓòÉΓòÉ 13.5.2. Access to Remote Systems ΓòÉΓòÉΓòÉ
  6152.  
  6153. The representation of a physical device as an application object may be 
  6154. extended to encompass any external entity with which an application must 
  6155. interact.  Suppose that an application executing in a programmable workstation 
  6156. must interface with a number of server applications executing in a System/370 
  6157. host, using the SRPI interface.  The host system may be regarded as a logical 
  6158. entity, and a single application object created to interact with that entity. 
  6159. All communications-related and interface-specific code may then be encapsulated 
  6160. within that object, and other objects within the application need not concern 
  6161. themselves with the details of the SRPI communication.  A message passed to the 
  6162. application object by a requesting object elsewhere in the application will 
  6163. contain the name of the server application to be invoked, and the data to be 
  6164. passed to the server application.  A return message from the host-interaction 
  6165. object will contain the reply data from the server application. 
  6166.  
  6167. Figure "Encapsulation of Host Interaction Within Application Object" 
  6168.  
  6169. The isolation of programming interfaces and protocols specific to the 
  6170. communications architecture, within the "Host" application object provides an 
  6171. easy means of insulating the remainder of the application from changes to 
  6172. communications network configurations or to the remote system itself.  Such 
  6173. changes would only require modification to the "Host" object. 
  6174.  
  6175.  
  6176. ΓòÉΓòÉΓòÉ 13.5.3. Procedure Manuals ΓòÉΓòÉΓòÉ
  6177.  
  6178. An administrative procedure, which is merely a set of information that 
  6179. documents the way in which a task must be performed, may also be regarded as a 
  6180. procedural entity that may be encapsulated in an application object. Such an 
  6181. application object typically contains a small number of methods, and may 
  6182. possibly contain only one. 
  6183.  
  6184. In the case of an object that contains only a single method and merely accepts 
  6185. data from a calling application object rather than possessing data objects of 
  6186. its own, the object may be regarded as simply a method rather than an 
  6187. application object in its own right.  Where it is desirable to invoke the 
  6188. procedure from a number of applications, the procedure may be placed in a 
  6189. separate executable module and dynamically bound to its calling applications, 
  6190. thereby maintaining independence of the procedure from the applications. 
  6191.  
  6192. A message is passed to the application object identifying the action to be 
  6193. performed and providing the necessary input data.  The application object will 
  6194. then typically carry out a modal dialog (or possibly a series of dialogs) with 
  6195. the end user to obtain any further information, leading the user through the 
  6196. necessary steps in the required order.  When the procedure has been completed, 
  6197. the application object terminates the dialog and possibly passes a message to 
  6198. its caller or to another application object, containing an acknowledgement of 
  6199. completion, or information collected during the procedure.  Where completion of 
  6200. a method is mandatory to correct execution of the application, this 
  6201. acknowledgement of completion provides a useful mechanism for the caller to 
  6202. determine that the method has been successfully executed. 
  6203.  
  6204. If such procedures are correctly defined at a generic level (for example, Enter 
  6205. the customer data), their application objects may be stored in a library and 
  6206. used by multiple applications.  More complex procedures may be constructed 
  6207. within an application by invoking a number of such application objects in 
  6208. sequence.  Acknowledgement messages from the application objects can be used to 
  6209. verify that the required steps have taken place. 
  6210.  
  6211. Thus it can be seen that the object-oriented paradigm, when the definition of a 
  6212. data object is sufficiently expanded to include all types of logical entity, 
  6213. and when properly applied with correctly designed application objects obeying 
  6214. the aforementioned rules and guidelines, is generally applicable to almost all 
  6215. applications.  A wide variety of applications may therefore achieve the 
  6216. modularization and reusability benefits afforded by an object-oriented design 
  6217. approach. 
  6218.  
  6219.  
  6220. ΓòÉΓòÉΓòÉ 13.6. Summary ΓòÉΓòÉΓòÉ
  6221.  
  6222. It can be seen from the foregoing discussion that the object-oriented paradigm 
  6223. is a logical consequence of the move toward data-centered application design. 
  6224. An object-oriented approach provides many benefits for applications which 
  6225. manipulate data, not the least of which is the ability to implement an 
  6226. intuitive, event-driven user interface where the user manipulates a number of 
  6227. conceptual objects in a metaphorical manner that mirrors the "real-life" 
  6228. manipulation of those objects. 
  6229.  
  6230. It should be stressed however, that object-oriented programming is not 
  6231. necessarily suited to all applications; its use is recommended only where data 
  6232. is the central factor in the application's task.  There may be situations where 
  6233. the procedure, rather than the data, is necessarily the focus of the 
  6234. application, or where an event-driven style of user interface is not 
  6235. appropriate to the task being performed.  In such cases, traditional structured 
  6236. programming techniques hold advantages over object-oriented programming. 
  6237. However, in situations where only a portion of the work task is procedurally 
  6238. oriented, it is possible for the two approaches to coexist within the same 
  6239. application. 
  6240.  
  6241. Object-oriented programming focuses on the principles of data abstraction and 
  6242. encapsulation, with all access to a data object being controlled by the 
  6243. application object which "owns" that data object.  This principle allows the 
  6244. object-oriented approach to facilitate the creation of reusable application 
  6245. objects, since the interface to an object is defined only by the messages it 
  6246. receives and dispatches.  The implementation details of the data objects or 
  6247. methods belonging to an application object are typically transparent to other 
  6248. application objects.  Thus the effects of changes to these data objects or 
  6249. methods may be contained within a single application object, easing the task of 
  6250. change management and application maintenance. 
  6251.  
  6252. A distinction must also be drawn between an object-oriented application design 
  6253. and an event-driven, object-action user interface.  The two concepts are 
  6254. complimentary in that the provision of a truly event-driven interface for the 
  6255. end user is dependent upon the application being designed and implemented 
  6256. according to object-oriented principles.  However, while the two concepts are 
  6257. complimentary, they are not identical and the difference must be borne in mind 
  6258. when designing an application. 
  6259.  
  6260. Object-oriented application design begins with a definition of logical data 
  6261. entities and their representations (data objects) in the system.  Once these 
  6262. data objects are defined, the actions relevant to each may be determined, and 
  6263. the design of the messages to convey each action and the methods necessary to 
  6264. achieve the actions may be undertaken.  The definition of messages and actions 
  6265. completes the high-level design of the application, and traditional functional 
  6266. decomposition techniques may then be applied to designing and developing the 
  6267. individual methods.  The independent nature of application objects and of the 
  6268. methods within an object facilitates modularization of the application, and 
  6269. allows the design, development and testing of the methods for each object to 
  6270. take place independently of the methods for other objects. 
  6271.  
  6272. A number of programming languages and tools exist which implement 
  6273. object-oriented programming practices to varying degrees.  These may exist in 
  6274. the form of object-oriented extensions to an existing programming language, or 
  6275. as complete programming languages in their own right.  The degree to which 
  6276. these products enforce object-oriented practices also varies from one product 
  6277. to the next.  It should be stressed however, that the implementation of 
  6278. object-oriented techniques in application design and development is not 
  6279. dependent upon the use of any particular tool or programming language, but 
  6280. rather depends on the correct application of object-oriented design concepts. 
  6281. When such concepts are correctly applied in the design of an application, it is 
  6282. quite possible to develop object-oriented applications in conventional 
  6283. programming languages such as "C".  The difference lies in the amount of 
  6284. latitude given to the individual application developer with respect to the 
  6285. interpretation of object-oriented principles. 
  6286.  
  6287. It may be argued with some justification, that according to many 
  6288. popularly-accepted definitions, the techniques offered in this chapter do not 
  6289. constitute a truly object-oriented application model.  However, such concepts 
  6290. as a full inheritance hierarchy are not directly supported by execution 
  6291. environments such as Presentation Manager, and are difficult to provide without 
  6292. the use of additional object-oriented programming tools.  It must be stressed 
  6293. that the methodology outlined herein is not intended to be a purist 
  6294. implementation of the full object-oriented paradigm, but is intended to 
  6295. illustrate the application of certain object-oriented principles to the design 
  6296. and implementation of Presentation Manager applications, in accordance with the 
  6297. module-based approach to object-oriented programming. 
  6298.  
  6299. These principles, when applied to the Presentation Manager environment, afford 
  6300. significant enhancements in the areas of code reusability and application 
  6301. modularity, and subsequent benefits with respect to reduced development time 
  6302. and effort, and easier application maintenance and change management. 
  6303. Additional tools may be utilized to apply further object-oriented principles to 
  6304. Presentation Manager application design, in order to achieve the benefits 
  6305. associated with a class-based approach to object-oriented programming. However, 
  6306. such tools typically have additional drawbacks that must be weighed against 
  6307. their advantages, with regard to the specific development scenario. 
  6308.  
  6309.  
  6310. ΓòÉΓòÉΓòÉ 14. The Presentation Manager Application Model ΓòÉΓòÉΓòÉ
  6311.  
  6312. The Presentation Manager environment lends itself to the implementation of 
  6313. object-oriented programs under the module-based approach to object-oriented 
  6314. design.  Presentation Manager provides far more than merely a means of 
  6315. displaying information on the screen.  It implements an event-driven, 
  6316. object-based application execution environment and provides many services 
  6317. required for the definition and manipulation of application objects and 
  6318. messages. 
  6319.  
  6320. This chapter will examine the execution environment provided by Presentation 
  6321. Manager, describe the structure of a Presentation Manager application, and 
  6322. illustrate the implementation of basic object-oriented concepts in the 
  6323. Presentation Manager environment. 
  6324.  
  6325.  
  6326. ΓòÉΓòÉΓòÉ 14.1. Windows ΓòÉΓòÉΓòÉ
  6327.  
  6328. A window is the embodiment of an application object within the Presentation 
  6329. Manager application model.  To the end user, a window appears as a rectangular 
  6330. display area on the screen.  From an application viewpoint however, the concept 
  6331. of a window is far more powerful than this. Windows may be of two basic types: 
  6332.  
  6333.  Display windows have a physical identity represented by a rectangular area on 
  6334.   a screen; in this case the window represents a view of a conceptual display 
  6335.   surface known as a presentation space, which is in fact a data entity being 
  6336.   represented on the screen.  This is the average end user's concept of a 
  6337.   window. 
  6338.  
  6339.  Object windows have no physical manifestation, and are merely addresses or 
  6340.   "handles" to which messages may be directed.  An object window is typically 
  6341.   associated with an entity such as a file or database, and is used to access 
  6342.   this entity and perform actions upon it.  The object window concept is very 
  6343.   important to the implementation of object-oriented principles under 
  6344.   Presentation Manager, since it enables the creation of non-visual objects 
  6345.   within the Presentation Manager application model.  See Parent/Child 
  6346.   RelationShip (Object Windows) for further information. 
  6347.  
  6348. Windows respond to events, communicated by way of messages, which may originate 
  6349. from Presentation Manager as a result of user interaction, or from other 
  6350. windows existing in the system.  Messages are routed to and between windows by 
  6351. Presentation Manager on behalf of the application.  Windows may interpret and 
  6352. process messages in different ways, in accordance with the concept of 
  6353. polymorphism. 
  6354.  
  6355. Each window existing in the system has a unique identifier known as its window 
  6356. handle, which is assigned by Presentation Manager when the window is created. 
  6357. This handle is used to identify a window in all communication between that 
  6358. window and other parties, such as Presentation Manager or the user.  The window 
  6359. handle is specified as the destination address used when passing messages to a 
  6360. window.  See Messages for further discussion of Presentation Manager messages. 
  6361. A window is always aware of its own handle, since the handle is part of every 
  6362. message passed to the window.  Presentation Manager provides a number of 
  6363. mechanisms by which a window may determine the handles of other windows in the 
  6364. system in order to pass messages to those windows; these mechanisms are 
  6365. described in Window Communication. 
  6366.  
  6367.  
  6368. ΓòÉΓòÉΓòÉ 14.1.1. Window Classes ΓòÉΓòÉΓòÉ
  6369.  
  6370. Since many windows may be in existence at any time, windows having similar 
  6371. properties and behavior are grouped into window classes, with each window 
  6372. belonging to a class being an instance of that class. Window classes may be 
  6373. public (defined by Presentation Manager and usable by all applications in the 
  6374. system) or private (defined by the application and accessible only by that 
  6375. application unless an application developer decides otherwise; see Creating 
  6376. Reusable Code).  Private window classes are registered to Presentation Manager 
  6377. by the application upon initialization of the application. 
  6378.  
  6379. Presentation Manager maintains control information relating to each window 
  6380. created in the system, including properties such as window text, current size 
  6381. and location, etc.  In addition to this information, an application may specify 
  6382. an additional area of storage to be included within the window control block 
  6383. for application data relating to that window.  This storage is known as window 
  6384. words. The presence and size of window words is determined for each window 
  6385. class at the time the class is registered to Presentation Manager.  However, a 
  6386. new storage area is defined for each instance of the class, and window words 
  6387. may therefore be used for instance data. Window words typically contain 
  6388. pointers to dynamically-defined application data structures, which in turn 
  6389. contain the instance data. 
  6390.  
  6391.  
  6392. ΓòÉΓòÉΓòÉ 14.1.2. Window Procedures ΓòÉΓòÉΓòÉ
  6393.  
  6394. Each window class is associated with a window procedure, which defines and/or 
  6395. establishes access to data objects and performs processing related to that 
  6396. window class.  In object-oriented terms, the window procedure contains the 
  6397. methods to carry out actions upon the data object referenced by the window. 
  6398.  
  6399. A window procedure is normally invoked by Presentation Manager on behalf of the 
  6400. application.  The window procedure interprets messages passed by Presentation 
  6401. Manager to the window and invokes a method (that is, a coherent set of 
  6402. application statements and/or routines) depending on the nature and contents of 
  6403. the message. 
  6404.  
  6405. See Window Procedures for a more complete discussion of window procedures' 
  6406. structure and behavior. 
  6407.  
  6408.  
  6409. ΓòÉΓòÉΓòÉ 14.2. Messages ΓòÉΓòÉΓòÉ
  6410.  
  6411. All interaction between the user and windows, or between one window and another 
  6412. in the Presentation Manager environment, takes place by way of messages. 
  6413. Whenever the user presses a key, moves or clicks the mouse, selects an item 
  6414. from a menu, etc., a message is generated and placed on a system message queue. 
  6415. Presentation Manager takes these messages in the order they were received by 
  6416. the system, determines the window for which each message is intended, and 
  6417. routes the message to a message queue belonging to the application that "owns" 
  6418. that window.  The application then dequeues each message in turn, and routes 
  6419. the message via Presentation Manager to the window procedure associated with 
  6420. that window, which processes the message. 
  6421.  
  6422. Messages may be of three types: 
  6423.  
  6424.  User-initiated ; that is, the message is generated as the result of the user 
  6425.   selecting an action-bar item, pressing a key, etc. 
  6426.  
  6427.  Application-initiated ; that is, the message is generated by one window 
  6428.   within the application for the communication of an event or required action 
  6429.   to another window. 
  6430.  
  6431.  System-initiated ; that is, the message is generated by Presentation Manager 
  6432.   as the result of some system event such as a window having been resized or 
  6433.   moved. 
  6434.  
  6435. A Presentation Manager application has the ability to process messages of any 
  6436. of the three types, which allows the application to respond to any type of 
  6437. event, regardless of its origin. 
  6438.  
  6439.  
  6440. ΓòÉΓòÉΓòÉ 14.2.1. Message Classes ΓòÉΓòÉΓòÉ
  6441.  
  6442. Messages are grouped into message classes, with each class representing a 
  6443. particular type of event such as character input, mouse movement, etc.  Many 
  6444. message classes are defined by Presentation Manager, and messages of these 
  6445. classes are usually dispatched by Presentation Manager to inform an application 
  6446. of system-initiated events.  These system-defined message classes are 
  6447. described, along with the default processing provided by Presentation Manager 
  6448. for each class, in the IBM OS/2 Version 2.0 Presentation Manager Reference. 
  6449.  
  6450. An application developer may define additional message classes unique to his or 
  6451. her particular application, for use by that application. Application-defined 
  6452. messages typically serve as a means of communication between windows, where one 
  6453. window passes information to another window, for processing by the window 
  6454. procedure associated with that window.  The destination window may then return 
  6455. a message to the calling window indicating completion, or may pass a message to 
  6456. a third window to trigger an additional action, dependent upon the requirements 
  6457. and design of the application. 
  6458.  
  6459. For example, the user may elect to update a file by selecting an item from a 
  6460. menu bar.  The window procedure associated with the display window to which the 
  6461. menu bar belongs may pass a message to an object window associated with the 
  6462. file to be updated.  The window procedure for this window would make the change 
  6463. and then pass a message to a third object window, which logs the update before 
  6464. passing a message back to the original window procedure indicating that the 
  6465. update is complete. 
  6466.  
  6467. Note that message classes need not be specific to a particular window class; 
  6468. messages of the same class may be passed to different window classes, with 
  6469. different results depending upon the processing of that message by the window 
  6470. procedure belonging to that window class.  This is in accordance with the 
  6471. object-oriented principle of polymorphism. 
  6472.  
  6473.  
  6474. ΓòÉΓòÉΓòÉ 14.2.2. Message Structure ΓòÉΓòÉΓòÉ
  6475.  
  6476. In order to allow any window the ability to process any message class, 
  6477. Presentation Manager defines a standard format for messages.  In the 
  6478. Presentation Manager environment, a message is composed of four distinct 
  6479. attributes: 
  6480.  
  6481.  A window handle identifying the window for which the message is intended 
  6482.  
  6483.  A message ID identifying the particular class of message 
  6484.  
  6485.  Two message parameters, which are 32-bit fields containing a variety of 
  6486.   information, depending upon the class of message received. 
  6487.  
  6488. All Presentation Manager applications must contain a message processing loop, 
  6489. which receives the message from Presentation Manager (see Application 
  6490. Structure), and routes it, using Presentation Manager message-dispatching 
  6491. functions, to the appropriate window procedure for processing.  Thus 
  6492. Presentation Manager actually invokes the window procedure on the application's 
  6493. behalf. 
  6494.  
  6495. Message Identifier 
  6496.  
  6497. The message ID identifies the message class to which each message belongs, and 
  6498. is in fact an integer value which is typically replaced by a symbolic name for 
  6499. ease of use.  The symbolic names for all system-defined message classes are 
  6500. defined by Presentation Manager; symbolic names for application-defined 
  6501. (private) message classes must be declared by the application developer in the 
  6502. application's source code.  This is typically achieved by declaring an integer 
  6503. constant, the value of which is specified as an offset from the system-defined 
  6504. value WM_USER.  For example: 
  6505.  
  6506. #define WMP_MYMESSAGE     WM_USER+6
  6507.  
  6508. The use of an offset to a system-defined constant, rather than an absolute 
  6509. numeric value, eliminates the chance of using the same integer value as a 
  6510. system-defined message class (with consequently unpredictable results), and 
  6511. avoids the necessity to alter application code should the number or definition 
  6512. of system-defined message classes be altered in future versions of Presentation 
  6513. Manager. 
  6514.  
  6515. Message Parameters 
  6516.  
  6517. As noted above, message parameters may contain a variety of information.  When 
  6518. used for communication between window procedures, the window handle of the 
  6519. calling window may be passed to the destination window as one of the message 
  6520. parameters, in order that the destination window procedure may dispatch an 
  6521. acknowledgement or reply message to the calling window.  Qualifiers to the 
  6522. message type or small items of data may also be passed; for example, the 
  6523. Presentation Manager-defined WM_COMMAND message class (indicating a menu 
  6524. selection by the user) uses the first message parameter to identify the menu 
  6525. item selected. 
  6526.  
  6527. When large data structures are required to be passed between window procedures, 
  6528. and the data obviously cannot be contained within the two 32-bit message 
  6529. parameters, the convention is to allocate a memory object for the required data 
  6530. structure using the DosAllocMem() function, and to pass a pointer to that 
  6531. memory object as a parameter to the message.  Presentation Manager provides a 
  6532. number of macros to enable various types of data to be placed into and 
  6533. retrieved from message parameters.  The insertion and retrieval of data into 
  6534. and from message parameters is described in Creating Message Parameters. 
  6535.  
  6536.  
  6537. ΓòÉΓòÉΓòÉ 14.2.3. Message Processing ΓòÉΓòÉΓòÉ
  6538.  
  6539. Messages passed to a window may be processed in one of two basic ways: 
  6540.  
  6541.  Synchronously, in which case the message is passed directly to the target 
  6542.   window and is processed immediately; the window from which the message 
  6543.   originated suspends its execution until the message is processed. 
  6544.  
  6545.  Asynchronously, in which case the message is placed on a queue from which it 
  6546.   is subsequently retrieved and passed to the target window; the window from 
  6547.   which the message originated continues execution immediately after the 
  6548.   message is placed on the queue. 
  6549.  
  6550. Synchronous and asynchronous processing are described in more detail in Window 
  6551. Procedures (Invoking a Window Procedure). 
  6552.  
  6553. A message may also be dispatched to multiple windows at the same time, using 
  6554. the message broadcasting facilities provided by the Presentation Manager 
  6555. programming interface.  Broadcasting may be either synchronous or asynchronous. 
  6556. The implementation of message broadcasting is discussed in more depth in Window 
  6557. Communication. 
  6558.  
  6559. Messages that are not explicitly processed by an application in its window 
  6560. procedures are passed to a default window procedure supplied by Presentation 
  6561. Manager, which contains default processing for all message classes (in the case 
  6562. of application-defined message classes, this default window procedure simply 
  6563. ignores the message).  This technique is in accordance with the principle of 
  6564. inheritance, in that a window procedure only contains methods for those message 
  6565. classes with which it is directly concerned, and allows other messages to be 
  6566. processed by the existing default window procedure.  Default processing for 
  6567. each message class is described in the IBM OS/2 Version 2.0 Presentation 
  6568. Manager Reference. 
  6569.  
  6570. For message classes that are processed by the application's window procedures, 
  6571. the last operation in the message processing should be to provide a return code 
  6572. to Presentation Manager.  In many cases, this return code determines whether 
  6573. Presentation Manager performs its default message processing, after the 
  6574. application's own message processing is complete.  The default message 
  6575. processing may or may not be desirable, depending upon application 
  6576. requirements.  This ability allows system-initiated events to be easily 
  6577. detected and trapped by a Presentation Manager, enabling the application to 
  6578. perform its own processing for the event before allowing the default processing 
  6579. to occur. 
  6580.  
  6581.  
  6582. ΓòÉΓòÉΓòÉ 14.3. Application Structure ΓòÉΓòÉΓòÉ
  6583.  
  6584. All Presentation Manager applications have a similar structure.  The 
  6585. application is composed of a main routine, which performs initialization and 
  6586. termination functions, and which contains the application's main message 
  6587. processing loop, and a number of window procedures that process messages for 
  6588. window classes created and/or used by the application.  These window procedures 
  6589. are invoked and messages passed to them by Presentation Manager on behalf of 
  6590. the application, as shown in Figure "Message Flow in a Presentation Manager 
  6591. Application". 
  6592.  
  6593. Window procedures may also pass messages between one another in order to 
  6594. communicate events.  The flow of messages between the window procedures is also 
  6595. controlled by Presentation Manager on behalf of the application. 
  6596.  
  6597.  
  6598. ΓòÉΓòÉΓòÉ 14.3.1. Main Routine ΓòÉΓòÉΓòÉ
  6599.  
  6600. The main processing routine of a Presentation Manager application performs a 
  6601. number of initialization and termination functions for the application, as 
  6602. shown in Figure "Structure of an Application's Main Routine". 
  6603.  
  6604. The application's main routine registers the application to Presentation 
  6605. Manager, creates the application's message queue and defines private window and 
  6606. message classes for the application before actual processing takes place. 
  6607. Other application-specific initialization processing may also take place at 
  6608. this time, such as the definition of global data items.  Note however, that the 
  6609. use of global data increases the interdependence of application modules and 
  6610. reduces the potential for subsequent code reuse.  Hence global data should be 
  6611. avoided wherever possible. 
  6612.  
  6613. The main routine also creates the application's main window.  Note that from an 
  6614. application viewpoint, a display window is actually a group of windows that 
  6615. appear and behave as a single unit.  Therefore the frame (with its associated 
  6616. title bar, menu bar, etc.) and the client areas are created separately, as 
  6617. shown in Figure "Structure of an Application's Main Routine".  This concept is 
  6618. explained in more detail in Window Hierarchy. 
  6619.  
  6620. During execution of the application, the only function of the main routine is 
  6621. to accept messages from the system queue and route them to window procedures 
  6622. via Presentation Manager.  This is performed using a message processing loop, 
  6623. which continues until a message of the system-defined class WM_QUIT is 
  6624. received, at which point the loop terminates and allows the application's 
  6625. termination processing to occur. 
  6626.  
  6627. Upon termination of the application, the main routine destroys any remaining 
  6628. windows, along with the application's message queue, and deregisters the 
  6629. application before terminating.  Any global data items acquired during 
  6630. initialization are also released at this time. 
  6631.  
  6632. When the user selects "Exit" from the menu bar, or selects the "Close" option 
  6633. on the system menu of the application's main window, the application is not 
  6634. automatically terminated.  These messages are passed to the window procedure 
  6635. for that window, and may be processed by the application.  The typical action 
  6636. performed by the window procedure in such cases is that a message of class 
  6637. WM_QUIT is posted to the application's message queue, which causes the message 
  6638. processing loop to terminate.  Conventions for closing windows and terminating 
  6639. applications are discussed further in Window Closure. 
  6640.  
  6641. Since Presentation Manager actually informs the application that it is being 
  6642. terminated rather than simply shutting the application down, the application is 
  6643. given a chance to perform any necessary termination processing and exit in an 
  6644. orderly manner.  When a window is destroyed, it receives a WM_DESTROY message 
  6645. from Presentation Manager, which may be processed by the window procedure to 
  6646. allow orderly termination of processing.  This enables the preservation of data 
  6647. integrity by Presentation Manager applications, which need not rely on the user 
  6648. completing a logical unit of work before terminating; any uncompleted units of 
  6649. work may be placed in an interim storage area on disk, or simply backed out as 
  6650. part of the WM_DESTROY message processing. 
  6651.  
  6652. This feature is also used by the "Shutdown" procedure of the Workplace Shell. 
  6653. When the user selects "Shutdown" from the menu bar, Presentation Manager posts 
  6654. a WM_QUIT message to the main window of each application executing in the 
  6655. system, informing the application that it is being terminated and allowing any 
  6656. termination processing to take place.  This facility allows for an orderly 
  6657. shutdown of the system and preserves the integrity of data objects. 
  6658.  
  6659.  
  6660. ΓòÉΓòÉΓòÉ 14.3.2. Window Procedures ΓòÉΓòÉΓòÉ
  6661.  
  6662. It has already been mentioned that each window class within an application, 
  6663. whether a display window or an object window, is associated with a window 
  6664. procedure, which receives all messages intended for windows within that class. 
  6665. The window procedure contains the methods used to perform actions upon the data 
  6666. object to which the window pertains, and thus contains the application logic 
  6667. for the manipulation of data objects.  It may thus be said that window 
  6668. procedures form the "heart" of a Presentation Manager application. 
  6669.  
  6670. Upon invocation, the window procedure determines the type of message passed to 
  6671. it, and may either process the message explicitly or pass it on to a default 
  6672. window procedure supplied by Presentation Manager for standard processing.  A 
  6673. window procedure is essentially an extended CASE statement, as illustrated in 
  6674. Figure "Structure of a Window Procedure".  Each case within the window 
  6675. procedure contains a set of application statements and/or routines necessary to 
  6676. perform a particular action.  Thus in object-oriented terminology, each case is 
  6677. a method in its own right. 
  6678.  
  6679. A window procedure is declared to return the type MRESULT, which is a 32-bit 
  6680. data type declaration provided by Presentation Manager, and indicates the 
  6681. nature of the window procedure's return value. Note that in the above example, 
  6682. the returned values differ depending upon the message class; see Returning from 
  6683. a Window Procedure below for further discussion.  Note also that in the default 
  6684. case shown in Figure "Structure of a Window Procedure", the window procedure 
  6685. did not decide the return value itself, but used the value returned by the 
  6686. Presentation Manager-supplied default window procedure. This is an established 
  6687. Presentation Manager convention. 
  6688.  
  6689. A window procedure should always be declared with the system linkage 
  6690. convention; this is typically achieved by declaring the function to be of type 
  6691. EXPENTRY.  This type identifier is defined in the system header file OS2DEF.H, 
  6692. and simply specifies use of the system linkage convention.  Use of the system 
  6693. linkage convention is required since a window procedure is invoked by 
  6694. Presentation Manager on the application's behalf, rather than directly by the 
  6695. application.  Note that under previous versions of OS/2, the EXPENTRY keyword 
  6696. resulted in use of the pascal linkage convention, for precisely the same 
  6697. reason. 
  6698.  
  6699. Subject to programming language conventions, a window procedure has the ability 
  6700. to define a data object or instance data, or to establish access to an existing 
  6701. data object as part of its initialization processing.  When a window is created 
  6702. by Presentation Manager in response to an application's request, Presentation 
  6703. Manager immediately dispatches a message of the system-defined class WM_CREATE 
  6704. to that window (see Figure "Structure of a Window Procedure").  The window 
  6705. procedure may process this message in order to define instance data or 
  6706. establish access to data objects.  Typically, a window procedure requests the 
  6707. allocation of a memory object as a control block for its instance data. 
  6708. Initial values for the instance data are then placed in the control block, and 
  6709. a pointer to the control block is stored in the window words.  A window 
  6710. procedure thus supports the object-oriented concept of encapsulation, by 
  6711. allowing the dynamic allocation of and establishment of access to data objects, 
  6712. within a single application object. 
  6713.  
  6714. Note that prior to allocating instance data or performing any other processing 
  6715. for the WM_CREATE message, a window procedure should invoke the default message 
  6716. processing provided by Presentation Manager in the WinDefWindowProc() function. 
  6717. This ensures that the initialization of Presentation Manager's control data for 
  6718. the window is completed prior to WM_CREATE processing by the window procedure. 
  6719. This in turn ensures that the window handle, window words, etc., will be 
  6720. available during the window procedure's WM_CREATE processing. 
  6721.  
  6722. Invoking a Window Procedure 
  6723.  
  6724. A window procedure is invoked by dispatching a message to a window of the class 
  6725. with which the window procedure is associated.  Messages passed to a window are 
  6726. typically initiated as the result of user interaction or application events, or 
  6727. by Presentation Manager to indicate system events. 
  6728.  
  6729. While window procedures may be invoked directly using a normal subroutine call, 
  6730. it is recommended that messages be used for all communication between window 
  6731. procedures.  This conforms to standard object-oriented practice, in that an 
  6732. object should be accessible only via a message passed to it. 
  6733.  
  6734. Messages may be used to invoke a window procedure in two ways: 
  6735.  
  6736.  A message may be sent directly to the window procedure using the WinSendMsg() 
  6737.   call, in which case the window procedure executes synchronously, and control 
  6738.   does not return to the calling procedure until processing is completed.  This 
  6739.   method of invocation is similar to a normal subroutine call, but preserves 
  6740.   the message-driven structure of the application.  Note that since the message 
  6741.   is sent directly to the window procedure and not placed on a queue, the 
  6742.   normal serialization of message processing is disturbed.  This may cause 
  6743.   different results from those intended by the user; thus WinSendMsg() should 
  6744.   be used with care. 
  6745.  
  6746.  A window procedure may also be invoked by posting a message to a queue 
  6747.   associated with the window procedure, using the WinPostMsg() call.  With this 
  6748.   call the window procedure executes asynchronously, and control returns to the 
  6749.   calling procedure immediately after the message is placed in the queue.  This 
  6750.   method of invocation provides a convenient and powerful means for serialized 
  6751.   and yet asynchronous processing.  It then becomes the responsibility of the 
  6752.   application developer to ensure synchronization between different window 
  6753.   procedures. 
  6754.  
  6755. Invoking a window procedure by posting a message to it via a queue has an 
  6756. advantage over the use of WinSendMsg() or a direct subroutine call in that, 
  6757. where multiple windows are passing messages to a single receiving window, these 
  6758. messages are queued by Presentation Manager and dispatched to the receiving 
  6759. object in the order in which they were initiated.  Provided all sending windows 
  6760. obey the established conventions and post messages to queues, this ensures the 
  6761. correct sequencing of message processing by the receiving window, helps 
  6762. preserve the user's intention and facilitates maintaining the integrity of data 
  6763. objects. 
  6764.  
  6765. A window procedure accepts four parameters upon invocation; these correspond to 
  6766. the four attributes of a message as described in Messages and to the parameters 
  6767. of the WinSendMsg() and WinPostMsg() functions, and are as follows: 
  6768.  
  6769.  1. The handle of the window for which the message was intended 
  6770.  
  6771.  2. A message-class identifier 
  6772.  
  6773.  3. Two 32-bit message parameters. 
  6774.  
  6775. Note that the behavior of a window procedure, and the result obtained from 
  6776. processing by a window procedure, are dependent upon the class and contents of 
  6777. the message sent to it.  Similarly, the same message class may be interpreted 
  6778. in a different manner by window procedures belonging to different window 
  6779. classes.  In this way, a window procedure supports the object-oriented concept 
  6780. of polymorphism. 
  6781.  
  6782. Window Procedure Processing 
  6783.  
  6784. A window procedure will normally determine the message class, and take action 
  6785. based upon that class and the contents of the message parameters.  Where the 
  6786. action involves the manipulation of data objects and/or instance data, the 
  6787. window procedure typically obtains access to the window's control block by 
  6788. retrieving its pointer from the window words.  The window procedure then has 
  6789. access to the data values, resource handles, etc., required to complete the 
  6790. action. 
  6791.  
  6792. Note that the example given earlier in this chapter contains explicit 
  6793. processing options for only four types of messages; the application allows 
  6794. Presentation Manager to handle all other types of messages, by passing the 
  6795. message to the system-supplied default window procedure using the 
  6796. WinDefWindowProc() function.  This illustrates one of the basic principles of a 
  6797. Presentation Manager application; the window procedure processes only those 
  6798. messages with which it is explicitly concerned, and passes all other messages 
  6799. to Presentation Manager for default processing.  A window procedure must pass 
  6800. such messages on to Presentation Manager, or unpredictable results may occur. 
  6801.  
  6802. This "catchall" approach to implementation also allows the stepwise 
  6803. implementation of methods during application development.  An application 
  6804. developer may code a window procedure such that all command messages are, by 
  6805. default, passed to a routine that displays a message informing the user that 
  6806. the requested action is not yet implemented.  As the method for each action is 
  6807. designed and coded, a case for that action may be added to the window 
  6808. procedure.  Thus implementation of methods for an object proceeds in a stepwise 
  6809. and independent fashion until all necessary methods are implemented. 
  6810.  
  6811. As mentioned earlier in this chapter and illustrated in Figure "Structure of a 
  6812. Window Procedure", a window procedure may process messages of any type, 
  6813. including the WM_DESTROY message, which is posted to a window upon termination. 
  6814. A window procedure may explicitly process this message in order to close files 
  6815. and terminate access to data objects in an orderly manner, thus preserving the 
  6816. integrity of those data objects.  This ability allows the window procedure to 
  6817. further support the principle of encapsulation. 
  6818.  
  6819. Returning from a Window Procedure 
  6820.  
  6821. By convention, a window procedure typically returns a Boolean value (type 
  6822. MRESULT) to its caller, to indicate the result of message processing for that 
  6823. message.  The value returned is significant, since Presentation Manager takes 
  6824. action depending upon that value.  The defined return values for each 
  6825. system-defined message class, along with the default processing provided by 
  6826. Presentation Manager for each class, are given in the IBM OS/2 Version 2.0 
  6827. Presentation Manager Reference.  Naturally, the return values for user-defined 
  6828. message classes are defined by the application developer. 
  6829.  
  6830. If the window procedure has been invoked synchronously using WinSendMsg(), the 
  6831. result is returned by Presentation Manager to the calling window procedure, 
  6832. which may interrogate and act upon it.  If the window procedure has been 
  6833. invoked asynchronously using the WinPostMsg() function, the result is returned 
  6834. to Presentation Manager only.  Presentation Manager then uses this result to 
  6835. determine whether any post-processing should be carried out for the message. 
  6836. Note that while the WinPostMsg() function call also provides a Boolean return 
  6837. code to the caller, this code only indicates whether the message was 
  6838. successfully posted to the queue, and not the successful processing of the 
  6839. message by the target window procedure. 
  6840.  
  6841.  
  6842. ΓòÉΓòÉΓòÉ 14.3.3. Dialog Procedures ΓòÉΓòÉΓòÉ
  6843.  
  6844. A dialog procedure is a special type of window procedure that is associated 
  6845. with a modal dialog box and processes messages intended for that dialog box. 
  6846. The structure of a dialog procedure is similar to that of a "normal" window 
  6847. procedure, and it processes messages in the same way, although certain message 
  6848. classes received by a dialog procedure are different from those received and 
  6849. processed by a normal window procedure.  The structure of a typical dialog 
  6850. procedure is shown in Figure "Structure of a Dialog Procedure". 
  6851.  
  6852. Since modal dialog boxes do not belong to a class, they are not registered to 
  6853. Presentation Manager in the manner of a normal window.  A dialog procedure is 
  6854. associated with a dialog box as part of a WinDlgBox() call, which loads a modal 
  6855. dialog box and processes the dialog as a single operation, or a WinLoadDlg() 
  6856. call, which loads the dialog box into memory but does not process it;  the 
  6857. dialog box may subsequently be processed by a WinProcessDlg() call.  The 
  6858. processes of providing input to and obtaining results from a dialog procedure 
  6859. are discussed in Building a Presentation Manager Application. 
  6860.  
  6861. Note that since a modeless dialog box is simply an optimized (non-sizable) 
  6862. window with no other inherent properties such as modality, it receives the same 
  6863. messages as a standard window, and its methods are therefore contained within a 
  6864. normal window procedure rather than a dialog procedure. 
  6865.  
  6866. Note that a dialog box must use the system linkage convention, since it is 
  6867. simply a specialized form of window procedure.  This is achieved using the 
  6868. EXPENTRY keyword. 
  6869.  
  6870. Upon creation, a dialog box receives a message of the system-defined class 
  6871. WM_INITDLG.  This is similar to the WM_CREATE message received by a normal 
  6872. window upon creation, and may be processed in a similar way.  The first 
  6873. parameter in the WM_INITDLG message may be used to pass a pointer to the dialog 
  6874. procedure, referencing a data structure containing initialization information 
  6875. or other application-specified data. 
  6876.  
  6877. A dialog box also receives messages of class WM_CONTROL indicating events 
  6878. occurring in control windows within the dialog box.  The window identifier of 
  6879. the control window that dispatched the message, along with the nature of the 
  6880. message, is indicated in the message parameters.  The WM_CONTROL message is 
  6881. described in the IBM OS/2 Version 2.0 Presentation Manager Reference.  The 
  6882. dialog procedure may wish to explicitly process events indicated by WM_CONTROL 
  6883. messages, or it may allow such messages to pass on to the default Presentation 
  6884. Manager-supplied dialog procedure WinDefDlgProc(). 
  6885.  
  6886. A dialog box also typically receives WM_COMMAND messages, which are generated 
  6887. when a pushbutton within the dialog box is pressed by the user. The identity of 
  6888. the pushbutton is indicated in the first parameter of the WM_COMMAND message. 
  6889.  
  6890. The symbolic names DID_OK and DID_CANCEL are defined by Presentation Manager, 
  6891. and by convention are used to refer to the "OK" and "Cancel" pushbuttons 
  6892. respectively. The definition of dialog boxes is described in detail in 
  6893. Presentation Manager Resources. 
  6894.  
  6895. A dialog procedure is terminated and the dialog box is destroyed when the 
  6896. dialog procedure issues a WinDismissDlg() call to Presentation Manager, 
  6897. typically as a result of the user pressing a pushbutton. By convention, this 
  6898. call specifies a parameter indicating TRUE if the user completed the dialog by 
  6899. pressing an "Enter" or "OK" pushbutton, or FALSE if the user cancelled the 
  6900. dialog by pressing a "Cancel" pushbutton.  The value specified in this 
  6901. parameter is returned to the window procedure that issued the WinDlgBox() or 
  6902. WinProcessDlg() call, as the return value from that call. 
  6903.  
  6904. Message boxes do not require an application-supplied procedure to carry out 
  6905. their processing.  The simple nature of the message box dialog allows it to be 
  6906. processed by Presentation Manager on the application's behalf, and to return 
  6907. the result to the application for subsequent action. 
  6908.  
  6909.  
  6910. ΓòÉΓòÉΓòÉ 14.3.4. Subroutines ΓòÉΓòÉΓòÉ
  6911.  
  6912. Subroutines may be used in a Presentation Manager application, in the same way 
  6913. as they are used in any other application. However, in order to conform to 
  6914. object-oriented practices, subroutine calls should only be used to achieve 
  6915. functional isolation within the methods of a single application object, or to 
  6916. perform a standard processing function that is common to a number of objects; 
  6917. in this case, the scope of each execution instance of the subroutine is limited 
  6918. to a single object.  In accordance with object-oriented programming guidelines, 
  6919. communication between objects (windows) should be achieved using messages, and 
  6920. hence window procedures should not be invoked directly as subroutines.  See 
  6921. Passing Control for further discussion on the use of subroutines in 
  6922. Presentation Manager applications. 
  6923.  
  6924.  
  6925. ΓòÉΓòÉΓòÉ 14.3.5. Partitioning the Application ΓòÉΓòÉΓòÉ
  6926.  
  6927. With the dynamic linking capabilities of OS/2, it is possible to partition an 
  6928. application into a number of executable modules.  A single base program may be 
  6929. augmented by one or more dynamic link libraries.  Such an approach has a number 
  6930. of advantages: 
  6931.  
  6932.  Application code that is only executed in exceptional circumstances, such as 
  6933.   little-used functions, exception and error-handling routines etc, is not 
  6934.   loaded unless it is required.  This may significantly reduce the load time 
  6935.   and memory requirements of the application. 
  6936.  
  6937.  Common functions may be shared between applications, since dynamic link 
  6938.   libraries are re-entrant and a single memory-resident copy of the library 
  6939.   code may be used by all applications.  This can further reduce the memory 
  6940.   requirements of an application. 
  6941.  
  6942.  Functions placed in dynamic link libraries are isolated from the main 
  6943.   application, and may be modified without the need to re-link the application. 
  6944.   This facilitates application maintenance and update, since only the new 
  6945.   version of the DLL need be distributed. 
  6946.  
  6947. Applications written for the Workplace Shell should be partitioned in this 
  6948. manner.  Since the shell displays all objects on the desktop at system 
  6949. initialization, all applications must potentially be loaded at this time.  This 
  6950. can dramatically increase the time required for system initialization, along 
  6951. with the overall memory requirements of the system. 
  6952.  
  6953. These requirements may be significantly reduced by having only the minimum code 
  6954. (that is, the code required to accept and identify messages) loaded at 
  6955. application startup, and placing all processing function into dynamic link 
  6956. libraries that are loaded only when one of their entry points is called. 
  6957.  
  6958. Application developers must give careful consideration to correct partitioning 
  6959. of the application. Groups of functions that are interdependent and which call 
  6960. one another, or are typically called in close sequence should be placed in a 
  6961. single DLL module.  Functions that are independent of one another should be 
  6962. placed in separate DLLs.  This approach will minimize the load time and memory 
  6963. requirements of the application. 
  6964.  
  6965.  
  6966. ΓòÉΓòÉΓòÉ 14.4. Presentation Manager Resources ΓòÉΓòÉΓòÉ
  6967.  
  6968. Presentation Manager allows the application developer to define application 
  6969. resources externally to the application code.  Resources may include 
  6970. definitions for the following items: 
  6971.  
  6972. Fonts                    Graphic fonts may be created and modified using the 
  6973.                          Font Editor supplied as part of the IBM Developer's 
  6974.                          Toolkit for OS/2 2.0. 
  6975.  
  6976. Icons                    Application and window icons, mouse-pointers and 
  6977.                          bitmaps may be created and modified using the Icon 
  6978.                          Editor supplied as part of the IBM Developer's Toolkit 
  6979.                          for OS/2 2.0. 
  6980.  
  6981. Menus                    Menu bars and pulldown menus may be defined for 
  6982.                          display windows. 
  6983.  
  6984. String Tables            Tables of text strings may be defined for use by an 
  6985.                          application. 
  6986.  
  6987. Accelerator Tables       Tables of accelerator keys (for example, F3 for Quit) 
  6988.                          may be defined for display windows. 
  6989.  
  6990. Help Tables              Tables of help panels may be defined for each display 
  6991.                          window or each control window in a dialog box.  See 
  6992.                          Adding Online Help and Documentation for further 
  6993.                          discussion of help panels. 
  6994.  
  6995. Dialog Templates         Dialog boxes may be created or modified and stored as 
  6996.                          dialog templates, using the Dialog Box Editor supplied 
  6997.                          as part of the IBM Developer's Toolkit for OS/2 2.0. 
  6998.  
  6999. Window Templates         Window templates may be created or modified and stored 
  7000.                          as window templates, using the dialog editor supplied 
  7001.                          as part of the IBM Developer's Toolkit for OS/2 2.0. 
  7002.  
  7003. Except where noted above, resources are defined in a resource script file, an 
  7004. ASCII text file that may be manipulated using a standard text editor. This 
  7005. resource script file serves as input to a resource compiler, which is provided 
  7006. as part of the IBM Developer's Toolkit for OS/2 2.0.  The resource compiler 
  7007. produces a precompiled version of the resources, which is then incorporated 
  7008. into the application's executable code or stored in a dynamic link library for 
  7009. use by one or more applications. 
  7010.  
  7011. It is usual for simple text-based resources such as menus and string tables to 
  7012. be placed directly into the resource script file using an ASCII text editor. 
  7013. However, non-textual resources such as icons or bitmaps, or more complex 
  7014. text-based resources such as dialog templates, are typically stored in separate 
  7015. files and referenced from the resource script file. 
  7016.  
  7017. A major benefit of defining such resources externally to the application is 
  7018. that changes may be made to resource definitions without affecting the 
  7019. application code itself.  Modifications such as new icons, altered commands or 
  7020. menus, etc., may be implemented quickly and easily by making simple changes at 
  7021. a single point in the application. 
  7022.  
  7023. As a further example, the task of providing national language versions of an 
  7024. application is simplified, since all text such as menus and messages may be 
  7025. defined outside the application code, and multiple language-specific versions 
  7026. of such resources may be linked into a single version of the application code. 
  7027. In this way, the user interface properties of a display window may be modified 
  7028. without affecting the internal implementation of the window procedure or its 
  7029. methods. 
  7030.  
  7031. The creation and use of Presentation Manager resources is discussed in 
  7032. Presentation Manager Resources. 
  7033.  
  7034.  
  7035. ΓòÉΓòÉΓòÉ 14.5. Creating Reusable Code ΓòÉΓòÉΓòÉ
  7036.  
  7037. The ability to define resources such as window and dialog templates externally 
  7038. to the application, in conjunction with the dynamic linking facilities provided 
  7039. by the OS/2 operating system, provides a powerful tool for the creation of 
  7040. generic application objects, comprised of window/dialog templates and their 
  7041. associated window or dialog procedures.  These application objects may be 
  7042. defined and stored in dynamic link libraries for subsequent use by one or more 
  7043. applications.  This practice is in accordance with the guidelines for Systems 
  7044. Application Architecture Common Applications, which provide for common 
  7045. application services within and between environments, as well as common user 
  7046. applications.  This concept is further discussed in Generic Application 
  7047. Modules.  Note however, that the use of generic application objects presupposes 
  7048. that the nature of and message interfaces to such application objects are 
  7049. well-defined and documented, in order to allow application developers to 
  7050. correctly select and interact with the generic objects. 
  7051.  
  7052. For instance, a standard dialog box that will be used by many applications 
  7053. could be defined in a dialog template, resource compiled and stored in a 
  7054. dynamic link library, along with the dialog procedure which performs the 
  7055. processing for that dialog.  The dialog can then be loaded from the DLL by any 
  7056. application which needs to use it.  The dialog need be coded only once, and may 
  7057. be modified at any time while requiring no source code changes to the 
  7058. applications that access it.  The fact that DLL code is not bound with the 
  7059. application at link edit time like other library code also means that no 
  7060. changes are required to the object code of the applications, and thus 
  7061. recompilation and link edit is not required.  An example of this technique is 
  7062. given in Presentation Manager Resources. 
  7063.  
  7064. The window or dialog procedure associated with a generic object should contain 
  7065. all the methods normally used to perform actions upon that object, but need not 
  7066. contain every action that will ever be necessary.  If an application requires a 
  7067. specialized action on a generic object (that is, a previously undefined action 
  7068. or a modification of an existing action), the window acting as a handle to that 
  7069. object may be subclassed, and a new window procedure substituted for the 
  7070. existing window procedure. This new window procedure would contain methods to 
  7071. process the specific messages in which it has an interest, and would then 
  7072. invoke the original window procedure to handle any other message classes, in 
  7073. accordance with the object-oriented principle of inheritance. Subclassing is 
  7074. discussed further in Subclassing. 
  7075.  
  7076.  
  7077. ΓòÉΓòÉΓòÉ 14.6. Window Hierarchy ΓòÉΓòÉΓòÉ
  7078.  
  7079. Presentation Manager organizes windows hierarchically; each window in the 
  7080. system has a parent, and may optionally have an owner.  These parent and owner 
  7081. relationships determine the behavior of the window in response to certain 
  7082. messages, and may be used by applications to navigate the window hierarchy. 
  7083.  
  7084.  
  7085. ΓòÉΓòÉΓòÉ 14.6.1. Parent/Child Relationship ΓòÉΓòÉΓòÉ
  7086.  
  7087. The parent/child relationship between windows is mentioned in OS/2 Version 2.0 
  7088. - Volume 3:  Presentation Manager and Workplace Shell, with regard to the 
  7089. clipping of a child window to the borders of its parent. However, this 
  7090. hierarchy goes further in Presentation Manager, since all windows, both display 
  7091. windows and object windows, have a designated parent window. For top-level 
  7092. display windows, this parent window is the desktop, and is identified by the 
  7093. HWND_DESKTOP constant.  Other display windows within an application, which are 
  7094. child windows of the application's main window, may have the top-level 
  7095. application window as their parent, or indeed subsequent levels of the window 
  7096. hierarchy may be created, dependent on application requirements.  A window's 
  7097. parent is identified to Presentation Manager by the application when the window 
  7098. is created.  Thus the window hierarchy within a particular desktop is 
  7099. dynamically defined at execution time. 
  7100.  
  7101. As well as being uniquely identified by its window handle, a child window may 
  7102. also be identified by a window identifier, which is unique between children of 
  7103. a particular parent window.  This identifier is an integer value, which in 
  7104. practice is usually replaced by a more meaningful symbolic name that defines an 
  7105. integer constant.  The window identifier is supplied as a parameter when the 
  7106. application requests creation of the window by Presentation Manager.  When a 
  7107. window's parent and identifier are known, the WinWindowFromID() function may be 
  7108. used to determine its window handle so that operations may be performed upon 
  7109. it.  See Window Communication for further information. 
  7110.  
  7111. The parent/child hierarchy is useful for application design purposes, since in 
  7112. many cases, a window and its children may be regarded and manipulated as a 
  7113. single unit.  For example, sizing a parent window automatically clips all 
  7114. children of that window to the boundaries of the parent, and closing a parent 
  7115. window results in each of its children being closed.  This simplifies the 
  7116. application logic required for applications that create multiple windows. 
  7117.  
  7118. Frame and Client Windows 
  7119.  
  7120. The concepts of frame and client areas for a window are discussed in OS/2 
  7121. Version 2.0 - Volume 3:  Presentation Manager and Workplace Shell.  In fact, 
  7122. these frame and client areas are separate windows in their own right; the frame 
  7123. window of the application's "main window" is a top-level window with the 
  7124. desktop as its parent, and the client window is a child of the frame window. 
  7125. Frame control windows such as maximize/minimize icons, the title bar, the menu 
  7126. bar, etc., are also separate windows from the application viewpoint, and are 
  7127. regarded as children of the frame window.  Note that although they are separate 
  7128. windows, the end user perceives and manipulates the entire group as a single 
  7129. unit. 
  7130.  
  7131. The frame window and its children all belong to system-defined generic window 
  7132. classes, and thus have their own window procedures defined by Presentation 
  7133. Manager.  The exception is the client window, the window class of which is 
  7134. defined by the application; the window procedure is therefore defined to 
  7135. Presentation Manager when the window class is registered.  Note that window 
  7136. procedures for system-defined window classes may be subclassed by the 
  7137. application in order to provide specialized processing of certain messages. 
  7138.  
  7139. The children of a frame window have specific window identifiers assigned to 
  7140. them by Presentation Manager.  These window identifiers are unique for each 
  7141. frame window.  The predefined window identifiers are shown in Table "Window 
  7142. Identifiers". 
  7143.  
  7144. These identifiers may be used to communicate with child windows of a particular 
  7145. frame window, without the necessity to determine the window handle of the child 
  7146. window.  This concept is applicable to all windows including control windows 
  7147. within a dialog box.  See Window Communication for further information. 
  7148.  
  7149. Object Windows 
  7150.  
  7151. Object windows do not have a parent in the visual sense, as considerations such 
  7152. as clipping do not arise (since the window is never displayed).  For the 
  7153. purposes of standardization, Presentation Manager considers every object window 
  7154. to have a conceptual parent; this parent may be referenced using the constant 
  7155. HWND_OBJECT.  This technique allows an object window to be created using the 
  7156. same Presentation Manager function as that used to create a display window.  It 
  7157. is also useful in allowing logical grouping of windows with similar functions, 
  7158. or which need to be treated as a group for application purposes, under a single 
  7159. conceptual parent. 
  7160.  
  7161. For example, all the object windows created by a particular application may be 
  7162. grouped as children of a single "dummy" parent window.  When the application 
  7163. terminates and wishes to destroy all these windows, only a single function call 
  7164. to destroy the parent need be issued; Presentation Manager will automatically 
  7165. destroy each of the children in turn before destroying the parent.  Due to the 
  7166. way in which Presentation Manager destroys windows by first passing a 
  7167. WM_DESTROY message to the window, each object window is given a chance to exit 
  7168. in an orderly manner. 
  7169.  
  7170.  
  7171. ΓòÉΓòÉΓòÉ 14.6.2. Window Ownership ΓòÉΓòÉΓòÉ
  7172.  
  7173. A window may have an owner as well as having a parent.  While a window's 
  7174. relationship to its parent is mainly concerned with display, the relationship 
  7175. with its owner is concerned primarily with function.  The owner is assumed to 
  7176. have some interest in events that take place within a window.  For example, a 
  7177. frame window is the parent of its frame control windows (icons, menu bar, 
  7178. etc.,) and is also their owner.  When certain events take place, such as the 
  7179. user selecting an item from a menu bar, the control windows notify their owner 
  7180. by dispatching notification messages (the menu bar for instance, typically 
  7181. dispatches a message of class WM_COMMAND).  Thus the owner receives 
  7182. notification of the event, and may perform some action in response. 
  7183.  
  7184. The concept of ownership is usually applied to system-defined window classes 
  7185. such as control windows.  Since the window procedures for these window classes 
  7186. are defined by Presentation Manager rather than by the application, it is 
  7187. necessary for a control window to notify its owner of any event that may be 
  7188. significant to the owner. 
  7189.  
  7190. There is typically no owner relationship between frame and client windows. 
  7191. Messages received by the frame window that are deemed to be of possible 
  7192. interest to the client window are passed to the client window automatically by 
  7193. the system-supplied frame window procedure, by virtue of the predefined 
  7194. parent/child relationship between the frame and client windows. 
  7195.  
  7196. Should application requirements dictate, the application developer may 
  7197. establish an owner relationship between any two windows within his/her 
  7198. application, provided those windows are created by the same thread.  Owner 
  7199. relationships are not permitted between windows created by different threads. 
  7200.  
  7201.  
  7202. ΓòÉΓòÉΓòÉ 14.6.3. Z-Order ΓòÉΓòÉΓòÉ
  7203.  
  7204. A desktop is typically regarded as a two-dimensional display space;  in fact, a 
  7205. desktop is three-dimensional, since when windows overlap on the desktop, one 
  7206. window is conceptually "on top of" the other.  This concept of "stacking" 
  7207. windows applies even when windows do not actually overlay one another on the 
  7208. desktop.  The order in which windows appear on the desktop is known as the 
  7209. z-order. The z-order is known to Presentation Manager, and a number of function 
  7210. calls are provided that enable an application to request window handles of 
  7211. specific windows in the z-order using the WinGetNextWindow() function to obtain 
  7212. the handle of the next window in the z-order, or the WinQueryWindow() function 
  7213. to obtain the handle of a window at a specified position in the z-order. 
  7214.  
  7215. Since the z-order changes dynamically as different applications create and 
  7216. destroy windows, Presentation Manager takes a "snapshot" of the desktop state 
  7217. when the application issues a WinBeginEnumWindows() call.  This function 
  7218. accepts a window handle as a parameter, and the z-order of all immediate 
  7219. children of that window is recorded by Presentation Manager.  A call to this 
  7220. function should be issued before any WinGetNextWindow() call is issued, or 
  7221. before any WinQueryWindow() call is issued that specifies a position in the 
  7222. z-order.  When the application no longer wishes to interrogate the recorded 
  7223. window hierarchy, a WinEndEnumWindows() call should be made. 
  7224.  
  7225. The concepts of z-order and window enumeration are useful in circumstances 
  7226. where an operation or sequence of operations must be performed on a number of 
  7227. windows in order.  Windows with the same parent always appear contiguously in 
  7228. the z-order, and thus may be easily processed in succession. 
  7229.  
  7230.  
  7231. ΓòÉΓòÉΓòÉ 14.7. Subclassing ΓòÉΓòÉΓòÉ
  7232.  
  7233. Windows may be subclassed by replacing the window procedure defined by the 
  7234. window class with another window procedure.  This new subclass window procedure 
  7235. typically processes some of the messages routed to it, and then calls the 
  7236. original window procedure to process any other messages.  This technique 
  7237. parallels the definition of subclassing given in Object-Oriented Applications. 
  7238.  
  7239. Presentation Manager implements subclassing by having the application call the 
  7240. WinSubclassWindow() function, specifying the handle of the window to be 
  7241. subclassed and the new subclass window procedure.  Note that only the window 
  7242. specified is affected by the WinSubClassWindow() function call; other windows 
  7243. of the same class are not subclassed.  Once the call is successfully issued, 
  7244. any messages destined for the original window procedure are automatically 
  7245. routed to the subclass window procedure by Presentation Manager.  The object 
  7246. (whether a window or the operating system) from which the message originated is 
  7247. unaware of the subclass window procedure's interference.  An example of a 
  7248. subclass window procedure is given in Figure "Subclass Window Procedure". 
  7249.  
  7250. The subclassing concept enables messages destined for particular windows to be 
  7251. intercepted and the processing resulting from certain messages to be altered. 
  7252. This provides a powerful mechanism that facilitates the creation and use of 
  7253. generic windows (application objects), while retaining the ability for the 
  7254. application to modify the behavior of such windows should the need arise.  The 
  7255. use of subclassing enables a newly created window to take on the properties and 
  7256. methods of existing window classes in accordance with the principle of 
  7257. inheritance. 
  7258.  
  7259. Presentation Manager enables the effect of subclassing a window to be reversed 
  7260. by the application issuing the WinSubclassWindow() call a second time for the 
  7261. same window, specifying the original window procedure.  Presentation Manager 
  7262. then routes messages directly to their intended destination.  This capability 
  7263. allows windows to be temporarily subclassed to meet changing requirements at 
  7264. different points during application execution. 
  7265.  
  7266.  
  7267. ΓòÉΓòÉΓòÉ 14.8. Summary ΓòÉΓòÉΓòÉ
  7268.  
  7269. It can be seen from the foregoing discussion that Presentation Manager provides 
  7270. a base that facilitates the implementation of module-based object-oriented 
  7271. conventions by application programs.  The concepts of an application object and 
  7272. its methods are implemented under Presentation Manager as a window and its 
  7273. window procedure. 
  7274.  
  7275. Windows are grouped into classes and a window procedure is associated with a 
  7276. window on the basis of its class, in a parallel to the concept of allocating 
  7277. methods to an object class rather than to individual instances of that class. 
  7278. Window classes are defined in isolation however, and the concept of an 
  7279. inheritance hierarchy is not imposed by Presentation Manager, thus further 
  7280. enhancing the potential for efficient reuse by increasing object granularity. 
  7281. Presentation Manager allows windows to be subclassed, in order to allow 
  7282. additional or modified methods to be applied to an object in response to new or 
  7283. specialized actions.  This provides an additional enhancement to the capability 
  7284. of code reuse, since it is not necessary to create a new object class in order 
  7285. to implement small modifications to an existing class. 
  7286.  
  7287. Windows communicate with the system and with each other by way of messages, 
  7288. which are queued and routed by Presentation Manager, and which are processed in 
  7289. a serial fashion by the target window procedure.  This messaging model is a 
  7290. practical implementation of the message-driven communication precept of 
  7291. object-oriented application design. 
  7292.  
  7293. While not supported explicitly by Presentation Manager, the object-oriented 
  7294. concept of encapsulation is supported implicitly by the ability of a window 
  7295. procedure to define and thus "own" a data object.  The concept of polymorphism 
  7296. is also supported by Presentation Manager, since the behavior and results 
  7297. obtained from a window procedure are dependent upon, and only upon the class 
  7298. and contents of messages sent to that window procedure.  In a similar fashion, 
  7299. the result of a message is dependent upon the window procedure (application 
  7300. object) to which it is passed.  The isolation of data objects within an 
  7301. application object facilitates the containment of change by enhancing 
  7302. application modularity, thus easing the task of change management and 
  7303. application maintenance. Table "Application Object/Window Correlation" 
  7304.  
  7305. The ability to encapsulate the definitions of data objects with the methods 
  7306. used to manipulate those objects, and to store the resulting application 
  7307. objects in object libraries, facilitates the notion of reusability, which is 
  7308. one of the central precepts of object-oriented programming.  The dynamic 
  7309. linking facilities provided by OS/2 further extend the potential for reusable 
  7310. application objects.  Reusable objects may be defined and stored for use by 
  7311. multiple applications;  indeed, multiple objects may direct messages to a 
  7312. single instance of an object executing in the system.  The message queueing and 
  7313. serialization provided by Presentation Manager ensures the correct sequence of 
  7314. processing to preserve the user's intention and facilitate the integrity of 
  7315. data objects. 
  7316.  
  7317. It may be seen that the concept of an application object as defined in 
  7318. Object-Oriented Applications and the implementation of a window under 
  7319. Presentation Manager have a strong correlation.  A window may be regarded as 
  7320. the identity of an application object.  That object is associated with a data 
  7321. object and a set of methods (the window procedure) that perform actions upon 
  7322. the data object.  Class-specific data is defined within the window procedure, 
  7323. while storage for instance data is defined dynamically and pointers typically 
  7324. stored in window words.  Windows communicate with the user and with one another 
  7325. by way of messages.  Thus the window is the implementation of an application 
  7326. object under Presentation Manager. 
  7327.  
  7328. Hence Presentation Manager provides an execution environment and a basic 
  7329. application architecture that supports the implementation of object-oriented 
  7330. applications, within the boundaries of IBM Systems Application Architecture. 
  7331. Although it does not provide a complete development environment that enforces 
  7332. object-oriented guidelines, it offers the basis upon which such a development 
  7333. environment may be based. 
  7334.  
  7335.  
  7336. ΓòÉΓòÉΓòÉ 15. The Flat Memory Model ΓòÉΓòÉΓòÉ
  7337.  
  7338. The task of dynamically allocating memory within an application is greatly 
  7339. simplified in the 32-bit OS/2 Version 2.0 environment through use of the flat 
  7340. memory model. The application developer need no longer be concerned with the 
  7341. maximum 64KB segment size imposed by the 80286 processor architecture.  Larger 
  7342. amounts of memory may be allocated and subsequently manipulated as single units 
  7343. known as memory objects, rather than as multiple segments as was the case with 
  7344. previous versions of OS/2.  This reduces application complexity, facilitating 
  7345. improved performance and reducing application development time. 
  7346.  
  7347. This chapter describes the use of the flat memory model for application 
  7348. programming, in order to allocate and manipulate system memory.  The chapter 
  7349. also examines the facilities provided by OS/2 Version 2.0 that enable 
  7350. applications to handle memory protection exceptions. 
  7351.  
  7352. The concept of the flat memory model is described in OS/2 Version 2.0 - Volume 
  7353. 1:  Control Program.  The functions necessary to manipulate memory from within 
  7354. applications are described in detail in the IBM OS/2 Version 2.0 Control 
  7355. Program Reference. 
  7356.  
  7357.  
  7358. ΓòÉΓòÉΓòÉ 15.1. DosAllocMem() Function ΓòÉΓòÉΓòÉ
  7359.  
  7360. The DosAllocSeg() function implemented under previous versions of OS/2 is 
  7361. replaced in Version 2.0 by the DosAllocMem() function, which allows allocation 
  7362. of memory objects greater than 64KB in size.  To take an example, Figure 
  7363. "Allocating Memory in Previous Versions of OS/2" shows the code necessary under 
  7364. OS/2 Version 1.3 to allocate a 72KB area of memory for use by an application. 
  7365. The application must then use pSegment1 to reference the lower 64KB and 
  7366. pSegment2 to reference the upper 8KB of the memory object.  This requires 
  7367. conditional testing for each memory reference, and thereby introduces 
  7368. additional complication to the application code.  Use of the DosAllocHuge() 
  7369. function simplifies this slightly, but arithmetic is still required in order to 
  7370. correctly calculate offsets within the higher area of memory. 
  7371.  
  7372. Under OS/2 Version 2.0, a single DosAllocMem() function call is required in 
  7373. order to perform the same task, as shown in Figure "Allocating Memory in OS/2 
  7374. Version 2.0". Subsequent references to this memory object may simply use a 
  7375. 32-bit offset within the allocated address range. 
  7376.  
  7377. Note that since OS/2 Version 2.0 uses paged memory internally, memory allocated 
  7378. using DosAllocMem() is always allocated in multiples of 4KB. Thus, a request 
  7379. for 10 bytes will actually result in a full 4KB page being committed in real 
  7380. storage.  Since this will lead to high fragmentation and consequent waste of 
  7381. memory, the allocation of many small memory objects using DosAllocMem() 
  7382. directly is not recommended.  Application developers should initially use 
  7383. DosAllocMem() to allocate the maximum storage likely to be required, and then 
  7384. use the DosSubAlloc() function to allocate individual memory objects.  This 
  7385. technique allows the storage of multiple small memory objects within the same 
  7386. 4KB page, thereby reducing fragmentation and making more efficient use of 
  7387. storage. 
  7388.  
  7389. Note that the DosAllocHuge() function provided under previous versions of OS/2 
  7390. has no counterpart under Version 2.0.  This function is not required since 
  7391. DosAllocMem() allows the theoretical allocation of memory objects of a size up 
  7392. to that of the application's entire process address space. 
  7393.  
  7394. Memory objects allocated using DosAllocMem() may be freed using the 
  7395. DosFreeMem() function. 
  7396.  
  7397.  
  7398. ΓòÉΓòÉΓòÉ 15.2. Allocating versus Committing Memory ΓòÉΓòÉΓòÉ
  7399.  
  7400. Under OS/2 Version 2.0, there is a distinction between allocating a memory 
  7401. object and committing that object. This distinction was not present in previous 
  7402. versions of OS/2, and is a very important concept for the application developer 
  7403. to grasp.  When a memory object is allocated, space is reserved in the linear 
  7404. address space, but no real storage or swap file space is reserved for the 
  7405. object.  This space is only reserved when the memory object or parts thereof 
  7406. are committed.  A memory object that has not been committed is known as a 
  7407. sparse object. 
  7408.  
  7409. A memory object may be committed in two ways: 
  7410.  
  7411.  It may be committed (in its entirety) at the time it is allocated, using the 
  7412.   PAG_COMMIT flag in the DosAllocMem() function. 
  7413.  
  7414.  It may be committed in stages at some later point, using the DosSetMem() 
  7415.   function. 
  7416.  
  7417. The former technique is intended for small memory objects, the size of which is 
  7418. fixed and can be determined in advance by the application developer.  The 
  7419. latter technique is intended for memory objects such as external data files, 
  7420. which may vary in size. 
  7421.  
  7422. Memory must be committed prior to being accessed by the application. Failure to 
  7423. do this will result in a page fault (Trap 000E) exception. 
  7424.  
  7425.  
  7426. ΓòÉΓòÉΓòÉ 15.2.1. Committing Storage at Allocation ΓòÉΓòÉΓòÉ
  7427.  
  7428. For memory objects that have a fixed size, such as internal application 
  7429. storage, control blocks and most instance data, memory objects should be 
  7430. committed immediately upon allocation, allowing the application to access the 
  7431. memory object without the inconvenience and additional overhead of explicitly 
  7432. committing the storage at a later time. 
  7433.  
  7434. Storage for a memory object may be committed using the PAG_COMMIT flag in the 
  7435. DosAllocMem() function call used to allocate the memory object, as shown in 
  7436. Figure "Committing Storage During Allocation". The above example creates a 72KB 
  7437. memory object in a similar manner to that shown in Figure "Allocating Memory in 
  7438. OS/2 Version 2.0", but commits the storage during allocation, so that is 
  7439. immediately available for use by the application. 
  7440.  
  7441.  
  7442. ΓòÉΓòÉΓòÉ 15.2.2. Dynamically Committing Storage ΓòÉΓòÉΓòÉ
  7443.  
  7444. Under DOS and previous versions of OS/2, it is common for an application to 
  7445. allocate a small memory segment to contain a data structure.  If the data 
  7446. structure outgrows the size of the segment, the segment size may be 
  7447. progressively increased using the DosReallocSeg() or DosReallocHuge() 
  7448. functions, moving the segments within the machine's physical memory in order to 
  7449. accommodate the increased size requirements.  This is not possible under 
  7450. Version 2.0, since the paged memory implementation does not allow memory 
  7451. objects to be moved within memory once they are allocated; hence the 
  7452. DosReallocSeg() and DosReallocHuge() functions have no counterparts in the 
  7453. 32-bit environment. 
  7454.  
  7455. Under OS/2 Version 2.0, an application can allocate an area of storage in its 
  7456. process address space, but may commit only a small amount of that storage at 
  7457. the time the application is initialized.  In this way, the application does not 
  7458. use a large amount of storage in a situation where it is not required, and 
  7459. thereby avoids placing unnecessary resource demands on the operating system. 
  7460. This can result in improved overall system performance. 
  7461.  
  7462. If the storage requirements for a memory object increase during execution (for 
  7463. example, the size of a spreadsheet increases), and exceed the amount of storage 
  7464. initially committed, the application may dynamically commit additional storage 
  7465. up to the maximum specified in the DosAllocMem() function call that allocated 
  7466. the memory object. 
  7467.  
  7468. This dynamic commitment of storage is typically achieved using the guard page 
  7469. technique.  A page within the memory object may be specified as a guard page 
  7470. using the PAG_GUARD flag in the DosAllocMem() function call or in a DosSetMem() 
  7471. call made subsequent to the allocation.  Once this is done, any memory 
  7472. reference to that page will generate a guard page exception.  The guard page 
  7473. exception warns the application that the upper boundary of the committed 
  7474. portion of a memory object has been reached, and allows appropriate action to 
  7475. be taken in order to avoid a page fault exception. 
  7476.  
  7477. Note that the memory protection scheme implemented by OS/2 Version 2.0 
  7478. allocates pages to individual processes.  An exception is only generated when 
  7479. an application attempts to write into a page which is not allocated to the 
  7480. current process under which the application is running.  If the page is 
  7481. allocated to the current process, no exception is generated.  Use of the guard 
  7482. page technique is therefore strongly recommended in circumstances where the 
  7483. amount of data to be written into a memory object is variable, or where the 
  7484. size of the memory object or its data may grow during execution. 
  7485.  
  7486. The recommended method of using guard pages is to initially allocate the memory 
  7487. object as a sparse object, and then commit the amount of storage required for 
  7488. the current size of the data, flagging the uppermost page of the memory object 
  7489. as a guard page.  This technique is shown in Figure "Using a Guard Page With a 
  7490. Memory Object". 
  7491.  
  7492. The example shown in Figure "Using a Guard Page With a Memory Object" allocates 
  7493. a memory object that is 72KB in size as a sparse object, commits the first two 
  7494. pages (8KB) of the object and specifies the uppermost of the two pages as a 
  7495. guard page.  Any attempt by the application to write into this uppermost page 
  7496. will result in a guard page exception. 
  7497.  
  7498. The guard page exception generated when an application attempts to write into a 
  7499. guard page can be trapped and processed by an application-registered exception 
  7500. handler, to commit further pages within the memory object.  A simple guard page 
  7501. exception handler is shown in Figure "Guard Page Exception Handler". 
  7502.  
  7503. The exception handler shown in Figure "Guard Page Exception Handler" handles 
  7504. two types of exception:  the guard page exception and the page fault exception. 
  7505. The latter occurs when an application attempts to write to an uncommitted page 
  7506. in the memory object that is not the guard page.  This can occur when a memory 
  7507. object is accessed in a non-sequential manner. 
  7508.  
  7509. The example shown above handles the guard page exception simply by committing 
  7510. the next page in the memory object, and making this page the new guard page. 
  7511. Guard page exceptions should not be allowed to pass through to the operating 
  7512. system's default guard page exception handler, since the default handler 
  7513. operates by committing the next lower page in the memory object and making this 
  7514. the new guard page.  This is done because the default handler is intended 
  7515. mainly to handle dynamic stack growth; stacks are always propagated downward. 
  7516.  
  7517. The exception handler shown in Figure "Guard Page Exception Handler" also 
  7518. handles the page fault exception, where a write operation is attempted into a 
  7519. page other than the guard page, which has not previously been committed.  The 
  7520. exception handler responds to this exception by querying the properties of the 
  7521. page in question and, if the page has been allocated but not yet committed, 
  7522. proceeds to commit the page. 
  7523.  
  7524. If the page has not been allocated (that is, it does not lie within the 
  7525. boundaries of the memory object), or if the exception is neither a guard page 
  7526. exception nor a page fault exception, the exception handler does not process 
  7527. the exception, and returns control to the operating system, which will invoke 
  7528. any other exception handlers registered for the current thread (see Exception 
  7529. Handling). 
  7530.  
  7531. A guard page exception handler is registered by the application using the 
  7532. DosSetExceptionHandler() function.  This function is illustrated in Figure 
  7533. "Registering a Guard Page Exception Handler". 
  7534.  
  7535. The DosSetExceptionHandler() function can also be used to register exception 
  7536. handlers for other types of system exception; see Exception Handling for 
  7537. further information. 
  7538.  
  7539. Note that OS/2 Version 2.0 provides its own exception handlers within the 
  7540. service layers for all 32-bit system functions.  These exception handlers allow 
  7541. the service routines to recover from page fault exceptions and general 
  7542. protection exceptions encountered due to bad pointers in applications' function 
  7543. calls.  The function call returns an ERROR_BAD_PARAMETER code rather than a 
  7544. Trap 00D or Trap 00E code, thereby allowing the application to recover.  This 
  7545. represents a significant enhancement over previous versions of OS/2, since it 
  7546. allows easier debugging and more flexible pointer handling. 
  7547.  
  7548.  
  7549. ΓòÉΓòÉΓòÉ 15.3. Suballocating Memory ΓòÉΓòÉΓòÉ
  7550.  
  7551. Under OS/2 Version 2.0, the granular unit of memory is the page. This means 
  7552. that the minimum possible memory allocation for a single DosAllocMem() function 
  7553. call is 4KB.  For example, if an application requests the allocation of 10 
  7554. bytes of storage, the operating system will allocate a full 4KB page; the 
  7555. remaining storage in this page will be wasted. 
  7556.  
  7557. It is therefore recommended that for dynamic allocation of small memory objects 
  7558. for uses such as instance data, each window procedure should use a single 
  7559. DosAllocMem() function call to allocate a storage pool, and subdivide this 
  7560. storage as required using the DosSubAlloc() function, as shown in Figure 
  7561. "Suballocating Memory". 
  7562.  
  7563. Storage must be suballocated in multiples of 8 bytes.  Any requested 
  7564. suballocation which is not a multiple of 8 bytes will have its size rounded up 
  7565. to a multiple of 8 bytes. 
  7566.  
  7567. Storage to be suballocated must first be allocated using the DosAllocMem() 
  7568. function, and initialized for suballocation using the DosSubSet() function. 
  7569. Note that control information for the suballocation uses 64 bytes of the 
  7570. storage pool; this must be taken into account when determining the size 
  7571. requirements for the pool. 
  7572.  
  7573. In Figure "Suballocating Memory", the storage in the pool is committed during 
  7574. allocation, since the example assumes that the total storage requirement is 
  7575. known in advance. In situations where the exact size of the storage required is 
  7576. not known, the storage may be allocated but not committed, and the 
  7577. suballocation procedure will then progressively commit storage as required. 
  7578. This is indicated by specifying the DOS_SPARSE_OBJ flag in the DosSubSet() 
  7579. function call. 
  7580.  
  7581. Memory that has been suballocated using the DosSubAlloc() function may be freed 
  7582. using the DosSubFree() function.  The storage is then available for future 
  7583. suballocation.  Note, however, that the suballocation procedure does not 
  7584. reorganize suballocated memory objects within a pool.  Thus freeing objects 
  7585. within the pool may result in memory fragmentation. 
  7586.  
  7587. A storage pool initialized for suballocation using the DosSubSet() function 
  7588. should be removed using the DosSubUnset() function before the memory in the 
  7589. pool is freed.  This function call releases the operating system resources used 
  7590. by the suballocation procedure. 
  7591.  
  7592. When using the C Set/2 compiler, the malloc() function may be used to allocate 
  7593. memory.  This function has many of the advantages of the DosSubAlloc() 
  7594. function, but avoids the need for the application to explicitly allocate, set 
  7595. and suballocate memory.  The malloc() function also provides greater 
  7596. independence for application code from the platform upon which it executes, 
  7597. allowing the application to be more easily migrated to platforms other than 
  7598. OS/2 Version 2.0. 
  7599.  
  7600. The malloc() function works as follows: 
  7601.  
  7602.  The first call to malloc() from a particular application (process) causes 
  7603.   malloc() to request a memory object from the operating system. The malloc() 
  7604.   service routine adds 16 bytes to the size specified in the function call, and 
  7605.   rounds the result upward to the next even power of 2.  This amount of memory 
  7606.   is then requested from the operating system using a DosAllocMem() call.  The 
  7607.   operating system will then allocate memory, rounding the service routine's 
  7608.   request size upward to the nearest multiple of 4KB.  The malloc() function 
  7609.   then fulfills the application's request, with some wastage due to the 
  7610.   page-granular allocation. 
  7611.  
  7612.  For subsequent calls to malloc(), the malloc() service routine first checks 
  7613.   whether it has sufficient memory remaining from a previous request; if so, it 
  7614.   allocates that memory and returns control to the application.  If not, the 
  7615.   service routine requests additional memory from the operating system using 
  7616.   the DosAllocMem() function. 
  7617.  
  7618. Note that the free() function, used to free memory which has been allocated 
  7619. using malloc(), does not return the memory to the operating system; rather, 
  7620. that memory is held by malloc() for future use.  In order to return memory to 
  7621. the operating system, the application must issue a heapmin() function call. 
  7622.  
  7623.  
  7624. ΓòÉΓòÉΓòÉ 15.4. Exception Handling ΓòÉΓòÉΓòÉ
  7625.  
  7626. The following outcomes are possible when a memory object is referenced by the 
  7627. application: 
  7628.  
  7629.  If the memory has not been allocated or committed, a general protection 
  7630.   exception (Trap 000D) will occur. 
  7631.  
  7632.  If the memory has been allocated but not committed, a page fault exception 
  7633.   (Trap 000E) will occur. 
  7634.  
  7635.   In both of the above cases, the exception is reported to the application's 
  7636.   general protection exception handler, if one has been registered by the 
  7637.   application.  The application may then deal with the error.  If an exception 
  7638.   handler has not been registered by the application, the default exception 
  7639.   handler provided by the operating system will terminate the application. 
  7640.  
  7641.  If the page to be referenced has been defined as a guard page, a guard page 
  7642.   exception is generated.  If the application has not registered its own 
  7643.   handler for this exception, the system's default handler will commit the 
  7644.   page, and mark the next page in the memory object as the new guard page for 
  7645.   the object.  Once the guard page exception has been processed, execution 
  7646.   proceeds normally. 
  7647.  
  7648.  If none of the above conditions occur, the memory object is accessed and 
  7649.   execution proceeds normally. 
  7650.  
  7651. Exception handlers for the various types of exception may be registered using 
  7652. the DosSetExceptionHandler() function, as shown in Figure "Registering a Guard 
  7653. Page Exception Handler". 
  7654.  
  7655. Note that unlike previous versions of OS/2, application handlers need not be 
  7656. written in assembly language;  high-level programming languages may be used. 
  7657.  
  7658. Exception handlers are registered on a per-thread basis, and multiple exception 
  7659. handlers may be registered for each thread.  When more than one exception 
  7660. handler is registered, the handlers are chained, with the most recent addition 
  7661. being placed at the start of the chain.  When an exception occurs, control is 
  7662. passed to the first handler, which may handle the exception and return 
  7663. XCPT_CONTINUE_EXECUTION, in which case the operating system returns control to 
  7664. the application. 
  7665.  
  7666. If the exception handler cannot handle a particular exception, it returns 
  7667. XCPT_CONTINUE_SEARCH, in which case the operating system passes control to the 
  7668. next exception handler in the chain.  In this way, control is eventually passed 
  7669. to the operating system's default exception handlers. 
  7670.  
  7671. When an exception handler is no longer required, it can be removed from the 
  7672. chain using the DosUnsetExceptionHandler() function. 
  7673.  
  7674. Exception handling and the various operating system exceptions that can occur 
  7675. are described in the IBM OS/2 Version 2.0 Control Program Reference. 
  7676.  
  7677.  
  7678. ΓòÉΓòÉΓòÉ 15.5. Shared Memory Objects ΓòÉΓòÉΓòÉ
  7679.  
  7680. By default, memory objects allocated by an application are private to the 
  7681. process in which that application executes.  However, OS/2 allows memory to be 
  7682. shared among applications for interprocess communication.  Shared memory 
  7683. objects are allocated in a similar manner to private memory objects, using the 
  7684. DosAllocSharedMem() function. 
  7685.  
  7686. Note that while private memory objects are allocated using addresses upward 
  7687. from the lower limit of the process address space, shared memory objects are 
  7688. allocated downward from the upper limit of the process address space. Hence the 
  7689. private and shared memory arenas grow toward one another as more memory objects 
  7690. are allocated during execution. 
  7691.  
  7692. Shared memory objects may be freed in the same manner as private memory 
  7693. objects, using the DosFreeMem() function. 
  7694.  
  7695.  
  7696. ΓòÉΓòÉΓòÉ 15.5.1. Named versus Anonymous Shared Memory Objects ΓòÉΓòÉΓòÉ
  7697.  
  7698. Shared memory objects may be named or anonymous.  Named shared memory objects 
  7699. have names of the form: 
  7700.  
  7701. \SHAREMEM\<objectname.ext>
  7702.  
  7703. A named shared memory object may be accessed by another process using the 
  7704. DosGetNamedSharedMem() function. 
  7705.  
  7706. An anonymous shared memory object must be declared as "giveable" or "gettable" 
  7707. when it is allocated, in order that it may be made available to other processes 
  7708. using the DosGiveSharedMem() or DosGetSharedMem() functions.  An example is 
  7709. given in Figure "Allocating Shared Memory". 
  7710.  
  7711. The DosGiveSharedMem() function can be used at any time to provide another 
  7712. process with a specified level of access to a memory object, provided that the 
  7713. owner of the memory object knows the process ID of the process to which access 
  7714. is to be given. 
  7715.  
  7716.  
  7717. ΓòÉΓòÉΓòÉ 15.5.2. Committing Shared Memory Objects ΓòÉΓòÉΓòÉ
  7718.  
  7719. Like private memory objects, shared memory objects have a distinction between 
  7720. allocating and committing storage.  Shared memory objects may be committed upon 
  7721. allocation, or subsequently using exception handlers and the DosSetMem() 
  7722. function.  The guard page technique may be used with shared memory objects as 
  7723. well as private memory objects. 
  7724.  
  7725. One distinction between shared memory objects and private memory objects is 
  7726. that private memory objects may be "de-committed" if the required amount of 
  7727. memory reduces during execution; that is, physical storage is released without 
  7728. releasing the corresponding address ranges in the process address space. 
  7729. Shared memory objects may not be de-committed, to avoid the situation where one 
  7730. process may de-commit a page that is being accessed by another process. 
  7731.  
  7732.  
  7733. ΓòÉΓòÉΓòÉ 15.6. Summary ΓòÉΓòÉΓòÉ
  7734.  
  7735. Dynamic memory allocation is greatly simplified under OS/2 Version 2.0, since 
  7736. the application developer is no longer required to explicitly code for the 
  7737. 80286 segmented memory model, with its size limitation of 64KB per segment. 
  7738. Larger units of memory may be allocated and manipulated as single units, 
  7739. simplifying application code and reducing development time for applications 
  7740. that manipulate large data structures. 
  7741.  
  7742. When executable modules compiled for different environments are executed within 
  7743. the same process, the operating system handles interaction between these 
  7744. modules through thunk layers.  The conversions made within the thunk layers are 
  7745. transparent to the application modules themselves, and do not require 
  7746. consideration by the application developer.  This enables executable files, 
  7747. dynamic link libraries, and resources from different environments to be mixed 
  7748. within the same application. 
  7749.  
  7750. In general, application developers using OS/2 Version 2.0 are provided with a 
  7751. greater level of function and, at the same time, may take advantage of greatly 
  7752. simplified application development through use of the 32-bit flat memory model, 
  7753. which removes much of the inherent complexity of memory manipulation within the 
  7754. application.  Developers may produce applications more efficiently under 
  7755. Version 2.0, and may easily migrate their applications to and from the OS/2 
  7756. Version 2.0 environment. 
  7757.  
  7758.  
  7759. ΓòÉΓòÉΓòÉ 16. Building a Presentation Manager Application ΓòÉΓòÉΓòÉ
  7760.  
  7761. While the steps necessary to create a Presentation Manager application are 
  7762. generally similar to those required to create any kind of application in the 
  7763. programmable workstation environment under OS/2, there are some specific 
  7764. considerations to be borne in mind with regard to the implementation of 
  7765. object-oriented concepts in Presentation Manager applications, since the 
  7766. Presentation Manager environment does not force the application developer to 
  7767. obey such guidelines.  Therefore, this chapter will discuss the implementation 
  7768. of the general concepts outlined in The Presentation Manager Application Model, 
  7769. in such a way that they conform to  object-oriented principles and achieve the 
  7770. highest level of modularity. 
  7771.  
  7772. For the purposes of discussion, this chapter will assume that the source code 
  7773. is written using the "C" language. Other programming languages may be used to 
  7774. create Presentation Manager applications while preserving the overall 
  7775. application architecture, provided these languages support the creation of 
  7776. reentrant code and allow recursion. 
  7777.  
  7778.  
  7779. ΓòÉΓòÉΓòÉ 16.1. Language Considerations ΓòÉΓòÉΓòÉ
  7780.  
  7781. Presentation Manager applications may be written using the following 
  7782. programming languages: 
  7783.  
  7784.  Assembler language 
  7785.  "C" 
  7786.  COBOL (OS/2 Version 1.2 and above) 
  7787.  FORTRAN (OS/2 Version 1.2 and above) 
  7788.  
  7789. The use of Assembler language should be avoided wherever possible.  While 
  7790. coding to such a low-level language may provide significant performance 
  7791. improvements in critical applications, it is typically more  costly in terms of 
  7792. programmer productivity and subsequent code maintenance.  Assembler code is 
  7793. also less portable than that written using higher-level languages. 
  7794.  
  7795. The requirements of the Presentation Manager execution environment restrict the 
  7796. use of the COBOL and FORTRAN languages.  Presentation Manager requires window 
  7797. procedures to be reentrant, and neither FORTRAN nor COBOL support the creation 
  7798. of reentrant code.  In addition, much of the default message processing 
  7799. provided by Presentation Manager results in synchronous messages being sent to 
  7800. window procedures.  This practice is effectively a recursive subroutine call, 
  7801. and requires window procedures to be written in a language that supports 
  7802. recursion.  Neither COBOL nor FORTRAN provide such support. 
  7803.  
  7804. In order to create COBOL or FORTRAN source code that executes in the 
  7805. Presentation Manager environment, the application developer must adopt one of 
  7806. two solutions: 
  7807.  
  7808.  1. Create a "C" program to provide the Presentation Manager windowing and 
  7809.     dialog management functions, and combine this program with called COBOL  or 
  7810.     FORTRAN subprograms to perform the actual processing for the application. 
  7811.  
  7812.  2. Create a "winproc-less" application, where a main routine written in COBOL 
  7813.     or FORTRAN creates a message-processing loop, captures  and explicitly 
  7814.     processes all message classes.  Such an application has  no window 
  7815.     procedures. 
  7816.  
  7817.  3. Use the "language support window procedure" provided with the OS/2 
  7818.     Programmer's Toolkit under OS/2 Version 1.3, which provides processing for 
  7819.     most message classes and returns selected messages to the application for 
  7820.     processing. 
  7821.  
  7822. Where the use of COBOL or FORTRAN is unavoidable, solution (1) above is 
  7823. recommended, since it provides additional flexibility, maintains SAA 
  7824. conformance, retains much of the object-oriented nature of the application, and 
  7825. allows the best use to be made of existing host COBOL or FORTRAN application 
  7826. code, since the subprograms used are invoked using standard language 
  7827. conventions, and data is passed to them using a  normal parameter list and 
  7828. returned the same way.  The subprograms therefore interact with the calling 
  7829. application in much the same way as an ISPF dialog, minimizing the requirement 
  7830. for modification of existing code and reducing the need to retrain application 
  7831. developers. 
  7832.  
  7833. Object-oriented programming languages such as Smalltalk and C++ are becoming 
  7834. increasingly popular for the creation of object-oriented code, and are 
  7835. well-suited to the Presentation Manager application model.  Organizations may 
  7836. wish to investigate the viability of these languages for particular development 
  7837. projects and environments. 
  7838.  
  7839.  
  7840. ΓòÉΓòÉΓòÉ 16.2. Function and Data Types ΓòÉΓòÉΓòÉ
  7841.  
  7842. Presentation Manager provides a number of specialized function and data type 
  7843. definitions (such as MRESULT, MPARAM, etc.) for use by Presentation Manager 
  7844. applications.  While these type definitions are not "standard" C language 
  7845. types, their use is strongly recommended.  OS/2 maps these type definitions 
  7846. into standard C language types using #define statements embedded in the OS/2 
  7847. header file os2.h.  Since the mapping may vary between OS/2 Version 1.3 and 
  7848. Version 2.0  due to differences between the 16-bit and 32-bit operating system 
  7849. architectures, the use of Presentation Manager's type definitions insulates the 
  7850. application source code from the underlying architecture. 
  7851.  
  7852.  
  7853. ΓòÉΓòÉΓòÉ 16.3. Object-Oriented Programming Practices ΓòÉΓòÉΓòÉ
  7854.  
  7855. While Presentation Manager allows an application developer to implement the 
  7856. fundamental concepts of object-oriented programming in his or her applications, 
  7857. it does not restrict the application developer to the use  of these 
  7858. conventions. Therefore to ensure the correct implementation of object-oriented 
  7859. conventions and to enable the maximum level of granularity, a number of 
  7860. guidelines are offered: 
  7861.  
  7862.  The use of multi-purpose application objects (window procedures) should be 
  7863.   avoided;  for example, a single window procedure should not handle both user 
  7864.   interaction and file access.  Manipulation of separate data objects should be 
  7865.   achieved using separate window procedures. Background data objects (that is, 
  7866.   files or databases) should be manipulated using object windows. 
  7867.  
  7868.  As a corollary of the above rule, multiple window procedures should not be 
  7869.   created to act upon a single data object; where possible, all actions on a 
  7870.   particular data object should be performed by a single window procedure. 
  7871.   This behavior simplifies any future maintenance should the definition of the 
  7872.   logical data entity or its representation change.  Note that this guideline 
  7873.   may need to be overridden in circumstances where an action requires lengthy 
  7874.   processing, in order to preserve application responsiveness. 
  7875.  
  7876.  The definition, creation and/or establishment of access to data objects 
  7877.   should be achieved, where possible, from within a window procedure in order 
  7878.   to preserve the concept of data encapsulation.  That is to say, the use of 
  7879.   global data should be minimized in order to enhance modularity and maximize 
  7880.   object independence. 
  7881.  
  7882.  The input, output and behavior associated with a window procedure should 
  7883.   depend solely on the class and contents of the messages it receives, and 
  7884.   should not depend on any other external data or parameter, other than a data 
  7885.   structure to which a pointer is passed as a message parameter.  This 
  7886.   preserves the concept of object polymorphism and enhances the potential for 
  7887.   reuse. 
  7888.  
  7889. These guidelines, when obeyed, will enable an application to conform to the 
  7890. established guidelines for object-oriented programming as discussed in 
  7891. Object-Oriented Applications. 
  7892.  
  7893.  
  7894. ΓòÉΓòÉΓòÉ 16.4. Application Main Routine ΓòÉΓòÉΓòÉ
  7895.  
  7896. A sample application main routine is illustrated in Figure "Sample Application 
  7897. Main Routine (Part 1) - Registration" and Figure "Sample Application Main 
  7898. Routine (Part 2) - Window Creation". The functions performed by the main 
  7899. routine are as follows: 
  7900.  
  7901.  1. Register the application to Presentation Manager, and obtain an anchor 
  7902.     block handle (that is, an application handle), using the WinInitialize() 
  7903.     function. 
  7904.  
  7905.  2. Create a message queue, into which Presentation Manager will place all 
  7906.     messages intended for the application, using the WinCreateMsgQueue() 
  7907.     function and passing both the anchor block handle and the required queue 
  7908.     size to Presentation Manager, which returns a message queue handle to the 
  7909.     application.  Note that if the queue size specified is zero (as shown in 
  7910.     the example above) then the default queue size of 10 messages is used. 
  7911.  
  7912.  3. Register one or more window classes, for the windows that will be created 
  7913.     by the application, and associate a window procedure with each window 
  7914.     class, using using the WinRegisterClass() function.  Parameters passed to 
  7915.     this function include the name of the window class and the name of the 
  7916.     window procedure to be associated with the class.  Presentation Manager 
  7917.     returns a Boolean value indicating success or failure.  Note the 4 bytes 
  7918.     (32 bits) requested for window words, which may be used by the window 
  7919.     procedure to store the address of its instance data block. 
  7920.  
  7921.  4. Create a main display window for the application, using two consecutive 
  7922.     WinCreateWindow() calls (as shown in Figure "Sample Application Main 
  7923.     Routine (Part 2) - Window Creation") or a single WinCreateStdWindow() call. 
  7924.     Note the separate handles used for the frame and client windows. The values 
  7925.     specified for fcdata.flCreateFlags control the appearance of the window, 
  7926.     the controls it contains and its position on the screen. 
  7927.  
  7928.  5. Optionally, create an entry for the application in the Workplace Shell 
  7929.     Window List, using the WinAddSwitchEntry() function.  Note that this step 
  7930.     is omitted from Figure "Sample Application Main Routine (Part 2) - Window 
  7931.     Creation" for reasons of clarity, and is shown separately in Figure 
  7932.     "WinAddSwitchEntry() Function". 
  7933.  
  7934.     Note that under OS/2 Version 2.0, the WinCreateSwitchEntry() function is 
  7935.     provided in addition to the WinAddSwitchEntry() function. These two 
  7936.     functions accept identical parameters and carry out identical tasks; the 
  7937.     WinCreateSwitchEntry() function is intended to provide consistent function 
  7938.     naming conventions.  The WinAddSwitchEntry() function is retained under 
  7939.     OS/2 Version 2.0 for compatability with existing applications, but use of 
  7940.     the WinCreateSwitchEntry() function is recommended. 
  7941.  
  7942.  6. Establish a message processing loop, whereby the application requests 
  7943.     Presentation Manager to supply messages from the system queue and 
  7944.     subsequently invokes Presentation Manager to dispatch them to the 
  7945.     appropriate window procedure. This loop uses nested WinGetMsg() and 
  7946.     WinDispatchMsg() calls. 
  7947.  
  7948.  7. Upon receivng the special message class WM_QUIT, which will cause 
  7949.     WinGetMsg() to return false and hence terminate the while loop, remove any 
  7950.     remaining windows using the WinDestroyWindow() function, remove the 
  7951.     application's entry from the Window List using the WinRemoveSwitchEntry() 
  7952.     function, destroy the message queue and deregister the application before 
  7953.     terminating.  These latter functions are achieved using the 
  7954.     WinDestroyMsgQueue() and WinTerminate() calls. 
  7955.  
  7956. The structure of the main routine is similar for both the application (that is, 
  7957. the application's primary thread) and any secondary threads created by the 
  7958. application.  See Multitasking Considerations for further discussion on 
  7959. secondary threads. 
  7960.  
  7961. In Figure "Sample Application Main Routine (Part 1) - Registration", note the 
  7962. use of the EXPENTRY keyword in the function prototype to specify the system 
  7963. linkage convention for the window procedure wpMain.  This is required whenever 
  7964. declaring a window procedure or dialog procedure, since such procedures are 
  7965. normally invoked by Presentation Manager on the application's behalf, rather 
  7966. than directly by the application. 
  7967.  
  7968. If the application is to appear in and be selectable from the Workplace Shell 
  7969. Window List, the main routine must issue a WinAddSwitchEntry() function call, 
  7970. after creating the application's main window and before entering the message 
  7971. processing loop. [Note that under OS/2 Version 2.0, use of the 
  7972. WinCreateSwitchEntry() function is recommended, for reasons of consistency in 
  7973. function names. ] This function call is shown in Figure "WinAddSwitchEntry() 
  7974. Function". 
  7975.  
  7976. Note that the application may set the swTitle field of the SwitchData structure 
  7977. to NULL.  Presentation Manager will then determine the title under which the 
  7978. application was started from the Presentation Manager shell, and use this title 
  7979. for the switch entry. 
  7980.  
  7981. The WinAddSwitchEntry() function returns a switch entry handle, which may be 
  7982. stored by the application and used during termination to remove the switch 
  7983. entry from the Workplace Shell Window List using the WinRemoveSwitchEntry() 
  7984. function. 
  7985.  
  7986. The switch entry may be accessed by a window procedure at any time during 
  7987. application execution.  The switch entry handle is obtained using the 
  7988. WinQuerySwitchHandle() function, and the SwitchData control structure may then 
  7989. be obtained using the WinQuerySwitchEntry() function, and altered using the 
  7990. WinChangeSwitchEntry() function.  This capability may be used to allow a window 
  7991. procedure to obtain the handle of the application's main window, in order to 
  7992. post or send messages to that window.  This is discussed in Identifying the 
  7993. Destination Window. 
  7994.  
  7995.  
  7996. ΓòÉΓòÉΓòÉ 16.5. Using Windows ΓòÉΓòÉΓòÉ
  7997.  
  7998. As mentioned in Window Procedures, window procedures within a Presentation 
  7999. Manager application are reentrant; that is, the same window procedure is used 
  8000. for multiple instances of the same window class.  However, a window class may 
  8001. have separate data objects associated with each instance of that class, which 
  8002. may be used to store temporary data necessary during the existence of that 
  8003. object;  such data is known as instance data.  These data objects may need to 
  8004. be  created/opened and initialized.  Upon the window being closed, data 
  8005. objects may need to be closed or destroyed in a controlled fashion. 
  8006.  
  8007. Presentation Manager allows such function to be performed by a window 
  8008. procedure, since messages are sent to a window by Presentation Manager 
  8009. informing the window procedure of events such as creation or closure of the 
  8010. window.  These messages are discussed below. 
  8011.  
  8012.  
  8013. ΓòÉΓòÉΓòÉ 16.5.1. Window Creation ΓòÉΓòÉΓòÉ
  8014.  
  8015. A window is created by Presentation Manager in response to the application 
  8016. issuing  a WinCreateStdWindow() function call or a WinCreateWindow() call; an 
  8017. example of the WinCreateWindow() call is given in Figure "Sample Application 
  8018. Main Routine (Part 2) - Window Creation". 
  8019.  
  8020. The first statement in the example specifies the attributes of the frame 
  8021. window, which are contained in the data variable fcdata.flCreateFlags. These 
  8022. values determine the control windows that are created with the frame window 
  8023. (FCF_SYSMENU, FCF_MINMAX etc), and also indicate to Presentation Manager that 
  8024. it should select the position of the window on the desktop (FCF_SHELLPOSITION). 
  8025.  
  8026. The window is then created in two steps; firstly the frame window is created, 
  8027. with the desktop as its parent, and then the client window is created with the 
  8028. frame window as its parent.  The frame window belongs to the system-defined 
  8029. window class WC_FRAME, whereas the client window belongs to an 
  8030. application-defined window class WCP_MAIN, which is assumed to have already 
  8031. been defined to Presentation Manager using a WinRegisterClass() call. 
  8032.  
  8033. If it is necessary to pass initialization information to a window upon its 
  8034. creation, this may be achieved using the CtlData parameter in the 
  8035. WinCreateWindow() function.  This parameter is a 32-bit pointer, which may 
  8036. reference an application-defined data  structure.  This pointer is passed to 
  8037. the window as the first parameter of the WM_CREATE message.  The window may, 
  8038. during its processing of this message, extract the pointer from the message 
  8039. parameter and use it to access the data structure.  See Figure "Sample 
  8040. Application Main Routine (Part 2) - Window Creation" for an  example of this 
  8041. technique. 
  8042.  
  8043. When an application requests that Presentation Manager creates a window of a 
  8044. particular class, a message of the system-defined class WM_CREATE is sent to 
  8045. the window procedure associated with that class.  The window procedure may 
  8046. capture this message by including a case for it, and perform any processing 
  8047. such as opening files or databases, allocating memory objects and setting 
  8048. instance data to initial default values. 
  8049.  
  8050. In coding the method for this message class, the first statement should be a 
  8051. call to WinDefWindowProc(), which will enable Presentation Manager to perform 
  8052. default processing and complete the initialization of  the window (such as 
  8053. allocating a window handle) before the application-specific processing is 
  8054. carried out.  If the default processing is not completed first, the window 
  8055. handle and any window words may not be allocated before the application makes 
  8056. function calls that reference them, thus causing these calls to fail. 
  8057.  
  8058. Where instance data or resource handles will be used by the window, and must be 
  8059. maintained beyond the processing of a single message, a data structure should 
  8060. be defined to contain these items.  Memory for the data structure should be 
  8061. requested from the operating system, and a  pointer to the memory object stored 
  8062. in the window words, as part of the  WM_CREATE processing.  See Instance Data 
  8063. and Window Words for further information. 
  8064.  
  8065.  
  8066. ΓòÉΓòÉΓòÉ 16.5.2. Window Processing ΓòÉΓòÉΓòÉ
  8067.  
  8068. During execution, a window processes messages passed to it by Presentation 
  8069. Manager, using the methods defined in its window procedure.  Upon receiving a 
  8070. message, the window procedure performs three basic tasks: 
  8071.  
  8072.  1. The window procedure determines the message class by examining the message 
  8073.     class identifier. 
  8074.  
  8075.  2. Depending upon the message class, the window procedure executes a series of 
  8076.     application instructions and/or subroutines to perform the action requested 
  8077.     by the message. 
  8078.  
  8079.  3. The window procedure passes a return code to Presentation Manager. 
  8080.  
  8081. As part of the second step above, the window procedure may extract necessary 
  8082. information from the parameters passed with the message, using a number of 
  8083. macros provided by Presentation Manager.  These macros are described in 
  8084. Creating Message Parameters. 
  8085.  
  8086. The window procedure may also gain access to instance data or resource handles 
  8087. stored in a control block during processing of previous messages. This control 
  8088. block is generally allocated upon creation of the window and a pointer to it 
  8089. stored in the window words.  The window procedure may retrieve this pointer 
  8090. from the window words at  the start of processing for the current message.  See 
  8091. Instance Data and Window Words. 
  8092.  
  8093.  
  8094. ΓòÉΓòÉΓòÉ 16.5.3. Window Closure ΓòÉΓòÉΓòÉ
  8095.  
  8096. A window is closed (removed from the screen and destroyed) by Presentation 
  8097. Manager in response to the application issuing a WinDestroyWindow() call, 
  8098. specifying the handle of the window to be destroyed.  In normal circumstances 
  8099. the handle of the frame window is specified; destroying the frame window 
  8100. destroys that window and all of its children, including the client window 
  8101. associated with that frame. 
  8102.  
  8103. When an application requests that Presentation Manager close a window, a 
  8104. system-defined message of class WM_DESTROY is sent to the client window, and 
  8105. thus to the window procedure associated with that class.  The window procedure 
  8106. may capture and process this message, backing out any uncompleted units of 
  8107. work, and destroying or terminating access to data objects.  The window 
  8108. procedure should then return a value of zero. 
  8109.  
  8110. Note that although closing and destroying a parent window will also close and 
  8111. destroy all children of that window, the WM_DESTROY message is sent to the 
  8112. parent window, and processed before the children are destroyed.  Hence when 
  8113. processing a WM_DESTROY message, a window procedure may assume that all its 
  8114. children still exist. 
  8115.  
  8116. If the user explicitly requests closure of a window by selecting the  "Close" 
  8117. option on the system menu, a system-defined message of  class WM_CLOSE is sent 
  8118. to the window procedure.  The window procedure  may also capture and process 
  8119. this message in a similar manner to that  used for WM_DESTROY messages. 
  8120.  
  8121. Note that explicit processing of the WM_CLOSE message class is recommended for 
  8122. all Presentation Manager windows, since the default processing provided by 
  8123. Presentation Manager causes a WM_QUIT message to be posted to the application's 
  8124. message queue. This may result in unwarranted termination of the application. 
  8125. The window procedure for a child window should process a WM_CLOSE message by 
  8126. issuing a WinDestroyWindow() call for its frame window.  The window procedure 
  8127. for an application's main window should process a WM_CLOSE message by posting a 
  8128. WM_QUIT message to itself.  This will cause the application to terminate (see 
  8129. Terminating an Application). 
  8130.  
  8131. In order to handle the closure of a window in the most elegant manner, the 
  8132. following course of action is recommended: 
  8133.  
  8134.  Explicit processing should be provided for both WM_CLOSE and WM_DESTROY 
  8135.   messages: 
  8136.  
  8137.    - A window procedure should process a WM_CLOSE message by issuing a 
  8138.      WinDestroyWindow() call for its own frame window if it is a child window, 
  8139.      or a WM_QUIT message to itself if it is an application's main window.  In 
  8140.      both cases, the window procedure should then return a value of zero. 
  8141.  
  8142.    - A window procedure should process a WM_DESTROY message by closing any 
  8143.      files or databases that it has opened, and freeing any resources such as 
  8144.      memory objects. 
  8145.  
  8146.  Selection of the "Exit" option from a menu bar should result in the closure 
  8147.   of the window to which the menu bar belongs, by  having the window procedure 
  8148.   issue a WinDestroyWindow() call for its frame window. If the window is the 
  8149.   application's main window, it should be closed by having the window procedure 
  8150.   post a WM_QUIT message to itself (see Terminating an Application). This will 
  8151.   result in a WM_DESTROY message being posted to the main window and each of 
  8152.   its children as part of the application's termination processing.  These 
  8153.   messages may be captured and processed by the appropriate window procedures 
  8154.   in order to close data objects, back out incomplete units of work, etc. 
  8155.  
  8156. The release of data objects and Presentation Manager resources is discussed in 
  8157. Instance Data and Window Words. 
  8158.  
  8159.  
  8160. ΓòÉΓòÉΓòÉ 16.5.4. Instance Data and Window Words ΓòÉΓòÉΓòÉ
  8161.  
  8162. For data that is private to a particular instance of a window class, each 
  8163. window may have an area of storage associated with it, assigned by Presentation 
  8164. Manager and located within the Presentation Manager control block for that 
  8165. window.  This area is known as the window words. The amount of space allocated 
  8166. for window words in a particular window class is variable, and is defined in 
  8167. the WinRegisterClass() function call at the time the class is registered to 
  8168. Presentation Manager. 
  8169.  
  8170. It is recommended that for storage of amounts of data larger than four bytes, a 
  8171. memory object is obtained from the operating system using  the DosAllocMem() or 
  8172. DosSubAlloc() functions, and a pointer to this object is placed in the window 
  8173. words of the associated window.  An example of this technique is given in 
  8174. Figure "Storing Instance Data in Window Words". 
  8175.  
  8176. A memory object corresponding to the size of the data structure MYSTRUCT is 
  8177. obtained from the operating system using the DosAllocMem() function, and a 
  8178. pointer to this memory object is set by the application. This pointer is then 
  8179. placed in the window words of the current window's parent (that is, the frame 
  8180. window) using the WinSetWindowULong() function, at offset QWL_USER.  A number 
  8181. of predefined Presentation Manager window classes, including the frame window 
  8182. class, contain a 32-bit word at this offset, which is available for application 
  8183. use. 
  8184.  
  8185. Note the use of the PAG_COMMIT flag in the DosAllocMem() function call. This 
  8186. flag causes storage to be allocated immediately for the memory object being 
  8187. created, since OS/2 Version 2.0 by default uses a two-phase process for dynamic 
  8188. memory allocation. 
  8189.  
  8190. The concept of committing memory is new to Version 2.0, and allows a storage 
  8191. map for the application to be defined, but the storage is not reserved in 
  8192. memory until it is needed, at which time the application may explicitly commit 
  8193. the storage using the DosSetMem() function.  Optionally, the application may 
  8194. set the PAG_COMMIT flag in the DosAllocMem() function call to commit the 
  8195. storage immediately upon allocation. 
  8196.  
  8197. Failure to commit storage, either by use of the PAG_COMMIT flag or the 
  8198. DosSetMem() function, will result in a page fault exception (Trap 000E) when 
  8199. the application attempts to write to the storage area.  The concept of 
  8200. allocating and committing storage is explained fully in OS/2 Version 2.0 - 
  8201. Volume 1:  Control Program, and the use of these techniques by applications is 
  8202. described in The Flat Memory Model. 
  8203.  
  8204. After the memory object containing instance data is initially allocated, the 
  8205. window procedure may access it during processing of subsequent messages by 
  8206. issuing a WinQueryWindowULong() call to Presentation Manager, as shown in 
  8207. Figure "Retrieving Instance Data from Window Words". 
  8208.  
  8209. Upon termination of the window by the application, the window procedure 
  8210. receives a WM_DESTROY message.  As described in Window Closure , the window 
  8211. procedure should process this message by releasing any resources to which it 
  8212. has access.  This includes the instance data control block, which must be 
  8213. released using the DosFreeMem() function as shown in Figure "Releasing Instance 
  8214. Data Storage". 
  8215.  
  8216. In the above example, the pointer to the instance data control block is first 
  8217. retrieved from the window words, giving access to the handles of any data 
  8218. objects or Presentation Manager resources obtained by the window, in order that 
  8219. these may be released.  Once this has been achieved, the memory object 
  8220. containing the control block is released by the window procedure.  Failure to 
  8221. release the data objects and resources before freeing the memory object would 
  8222. result in a general protection exception (Trap 000D) when the data objects or 
  8223. resources were subsequently released. 
  8224.  
  8225.  
  8226. ΓòÉΓòÉΓòÉ 16.5.5. Subclassing a Window ΓòÉΓòÉΓòÉ
  8227.  
  8228. The use of subclassing to modify the methods of an existing window class has 
  8229. been described in Subclassing.  An application subclasses a particular window 
  8230. instance (rather than the entire window class) by creating a subclass window 
  8231. procedure, and registering this window procedure to Presentation Manager using 
  8232. the WinSubclassWindow() function. 
  8233.  
  8234. The use of the WinSubclassWindow() function is shown in Figure 
  8235. "WinSubclassWindow() Function". 
  8236.  
  8237. The WinSubclassWindow() function substitutes a new window procedure, known as 
  8238. the subclass window procedure, for the original window procedure associated 
  8239. with the window being subclassed.  The window handle of the window, along with 
  8240. the entry point of the  subclass window procedure, is passed to the 
  8241. WinSubclassWindow() function.  The function returns the entry point address of 
  8242. the original window procedure for that window. 
  8243.  
  8244. Once a window has been subclassed, Presentation Manager routes messages 
  8245. destined for that window to the subclass window procedure. The subclass window 
  8246. procedure may: 
  8247.  
  8248.  Process the message itself, if it indicates an action for which the method 
  8249.   must be modified. 
  8250.  
  8251.   The subclass window procedure then returns control immediately to 
  8252.   Presentation Manager. 
  8253.  
  8254.  Pass the message on to the original window procedure for that window, if the 
  8255.   subclass window procedure is not explicitly concerned with the action 
  8256.   indicated by the message. 
  8257.  
  8258.   The original window procedure is directly invoked by the subclass window 
  8259.   procedure; note that this is one of the few instances where direct invocation 
  8260.   of a window procedure is recommended.  The return code from the original 
  8261.   window procedure is then returned to Presentation Manager. 
  8262.  
  8263.  Both of the above, if the subclass window procedure must perform some 
  8264.   processing in addition to that normally performed by the original window 
  8265.   procedure. 
  8266.  
  8267.   The additional processing performed by the subclass window procedure may be 
  8268.   performed either before or after the processing performed by the original 
  8269.   window procedure.  This sequence is at the discretion of the application 
  8270.   developer, and depends largely on the desired modification in the window's 
  8271.   behavior. 
  8272.  
  8273. A subclass window procedure is similar in structure to a "normal" window 
  8274. procedure, except that instead of calling the WinDefWindowProc() function as 
  8275. its default case, it should invoke the original window procedure.  This means 
  8276. that the entry point address of the original window procedure must be known to 
  8277. and accessible from the subclass window procedure.  Note also that the entry 
  8278. point address might not be that of the original window procedure specified when 
  8279. the window class was registered to Presentation Manager, since the window might 
  8280. previously have been subclassed, and the current subclassing operation might be 
  8281. effectively subclassing the subclass window procedure. 
  8282.  
  8283. The entry point address of the original procedure can be supplied to the 
  8284. subclass window procedure in a number of ways: 
  8285.  
  8286.  It may be determined from the information returned by the WinSubclassWindow() 
  8287.   call, and passed to the subclass window procedure in an application-defined 
  8288.   message.  The subclass window procedure may then store the entry point 
  8289.   address in a global variable or in the window words of the window, assuming 
  8290.   the available window words are not already in use. 
  8291.  
  8292.  It may be determined by the subclass window procedure itself by querying 
  8293.   Presentation Manager.  Note, however, that this method will only work if the 
  8294.   window has not previously been subclassed, since Presentation Manager only 
  8295.   records the original window procedure (as specified in the WinRegisterClass() 
  8296.   function call) in the CLASSINFO structure for the window. 
  8297.  
  8298. An example of a subclass window procedure, including a query to obtain the 
  8299. original entry point address from the Presentation Manager class information, 
  8300. is given in Figure "Subclass Window Procedure". Figure "Subclass Window 
  8301. Procedure" shows each of the possible cases listed above.  The message class 
  8302. WMP_MESSAGE1 is explicitly processed by the subclass window procedure, which 
  8303. then returns control to Presentation Manager with a return statement upon 
  8304. completion. 
  8305.  
  8306. The message class WMP_MESSAGE2 is also explicitly processed by the subclass 
  8307. window procedure, but in this case it is required that the processing performed 
  8308. by the original window procedure be allowed to occur, after the subclass window 
  8309. procedure's processing.  The subclass window procedure therefore does not 
  8310. return control immediately to Presentation Manager, but merely terminates the 
  8311. switch statement, allowing  the final four statements to be executed. 
  8312.  
  8313. For other message classes with which the subclass window procedure is not 
  8314. concerned, the default case also terminates the switch statement, allowing the 
  8315. final four statements to be executed. 
  8316.  
  8317. These final statements determine the entry point address of the original window 
  8318. procedure, using the WinQueryClassName() and WinQueryClassInfo() functions to 
  8319. access control information held by Presentation Manager.  This entry point 
  8320. address is then used to invoke the original window procedure to process 
  8321. messages with which the subclass window procedure is not concerned, or for 
  8322. which the normal processing must be allowed to occur. 
  8323.  
  8324. The last four statements in the example above are common to all subclass window 
  8325. procedures, and organizations undertaking development of Presentation Manager 
  8326. applications may wish to incorporate them into a standard subroutine and place 
  8327. them in a library for access by developers. 
  8328.  
  8329. Note that a subclass window procedure, like all window and dialog procedures, 
  8330. must use the system linkage convention.  This is normally achieved by declaring 
  8331. the subclass window procedure using the EXPENTRY keyword. 
  8332.  
  8333.  
  8334. ΓòÉΓòÉΓòÉ 16.6. Window Communication ΓòÉΓòÉΓòÉ
  8335.  
  8336. Presentation Manager provides a number of mechanisms for communicating between 
  8337. windows.  All of these mechanisms use the Presentation Manager message concept. 
  8338. The exact technique used in any particular situation is dependent upon the 
  8339. nature of the communications and the types of windows involved. 
  8340.  
  8341.  
  8342. ΓòÉΓòÉΓòÉ 16.6.1. Standard Windows ΓòÉΓòÉΓòÉ
  8343.  
  8344. Data may be passed to a window upon its creation, using the CtlData parameter 
  8345. of the WinCreateWindow() function.  The contents of this parameter (a 32-bit 
  8346. pointer) are passed  to the target window as a parameter to the WM_CREATE 
  8347. message.  The contents may then be extracted from the message parameter and 
  8348. used by the window procedure. 
  8349.  
  8350. When an application wishes to pass a message between two standard windows that 
  8351. currently exist, whether they are display windows or object windows, either of 
  8352. two methods may be used, depending on whether the desired communication is to 
  8353. be synchronous or asynchronous. 
  8354.  
  8355.  When a synchronous message is to be passed, the WinSendMsg() function is 
  8356.   used, and the target window procedure is invoked directly by Presentation 
  8357.   Manager, in a similar fashion to a normal function call.  The return code 
  8358.   from the window procedure is passed by Presentation Manager to the calling 
  8359.   window procedure, where it may be interrogated and acted upon. 
  8360.  
  8361.  When a message is to be processed asynchronously, the WinPostMsg() function 
  8362.   is used.  In this case the message is posted to a queue associated with the 
  8363.   thread that created the target window, and the return code to the calling 
  8364.   window procedure merely indicates that the message was successfully placed on 
  8365.   the queue.  In order for the target window procedure to pass a return code or 
  8366.   acknowledgement back to the calling window procedure, it must include another 
  8367.   WinPostMsg() call as part of the processing of the message. 
  8368.  
  8369. The use of WinPostMsg() is recommended over that of WinSendMsg(), since posted 
  8370. messages are processed in the order in which they arrive in the queue, and the 
  8371. integrity of the user's intention is thus preserved in the order of processing. 
  8372. In addition, synchronous window procedures are invoked and executed without the 
  8373. original window procedure completing its processing and returning control to 
  8374. the message processing loop.  Thus the application  is prevented from 
  8375. processing additional user interaction, which may  lead to violation of the SAA 
  8376. CUA responsiveness guidelines. 
  8377.  
  8378.  
  8379. ΓòÉΓòÉΓòÉ 16.6.2. Dialog Boxes ΓòÉΓòÉΓòÉ
  8380.  
  8381. Communication between a standard window and a modeless dialog box is achieved 
  8382. in a similar fashion to that used between two standard windows, since the 
  8383. modeless dialog box is merely a normal window without a sizable border. 
  8384. However, communication between a standard window and a modal dialog box must be 
  8385. achieved in a different manner, since a modal dialog box is typically loaded 
  8386. and processed in a single WinDlgBox() function call, and the dialog box only 
  8387. has an existence during the execution of that function call.  An example of the 
  8388. WinDlgBox() function is shown in Figure "WinDlgBox() Function". 
  8389.  
  8390. Data may be passed to a dialog procedure at initialization time by creating a 
  8391. data structure and passing a pointer to that structure in the CreateParams 
  8392. field of the WinDlgBox() function, as shown in Figure "WinDlgBox() Function". 
  8393. This pointer is passed to the dialog procedure as the second parameter of the 
  8394. WM_INITDLG message, and may be accessed by the dialog procedure during the 
  8395. processing of this message.  Note that this is the only time at which input may 
  8396. be passed to a dialog box, since the dialog is processed within the scope of a 
  8397. single application statement; either a WinDlgBox() call or a WinProcessDlg() 
  8398. call may be used.  The WM_INITDLG message is described in the IBM OS/2 Version 
  8399. 2.0 Presentation Manager Reference. 
  8400.  
  8401. Information may be conveyed from a dialog procedure to its calling window 
  8402. procedure in one of two ways: 
  8403.  
  8404.  The dialog box may provide an unsigned integer (USHORT) parameter to the 
  8405.   WinDismissDlg() function, and this value is passed to the calling window 
  8406.   procedure as the return code from the WinDlgBox() function.  This technique 
  8407.   is useful where an acknowledgement or simple return data must  be conveyed. 
  8408.  
  8409.  The dialog box may issue a WinPostMsg() call to pass a message to the queue 
  8410.   associated with its calling window. The window procedure may then receive and 
  8411.   process that message in the normal way.  This technique is useful when more 
  8412.   complex data or structures must be conveyed. 
  8413.  
  8414. The latter technique above may also be used to convey information to  a window 
  8415. other than the window that invoked the dialog.  This may be necessary in 
  8416. situations where a dialog box is invoked by one window procedure on behalf of a 
  8417. group of windows. 
  8418.  
  8419.  
  8420. ΓòÉΓòÉΓòÉ 16.6.3. Control Windows ΓòÉΓòÉΓòÉ
  8421.  
  8422. As mentioned in Systems Application Architecture CUA Considerations, control 
  8423. windows are typically used in dialog boxes, and are hence accessed from the 
  8424. dialog procedure associated with their parent dialog box.  Such communication 
  8425. is synchronous in nature, since it usually involves insertion or retrieval of 
  8426. data into or from control windows, or other tasks that are part of the modal 
  8427. dialog with the user. 
  8428.  
  8429. Under OS/2 Version 2.0, some additional functions have been introduced into the 
  8430. Presentation Manager programming interface, to ease more complex 
  8431. communications, such as those involving list boxes.  Since communication with 
  8432. list boxes is therefore somewhat different from that involving other control 
  8433. window classes, list boxes are discussed separately in List Boxes below. 
  8434.  
  8435. General Control Windows 
  8436.  
  8437. Communication between a dialog procedure and the control windows associated 
  8438. with its dialog box is typically achieved using the WinSendDlgItemMsg() 
  8439. function, which is documented in the IBM OS/2 Version 2.0 Presentation Manager 
  8440. Reference.  This function  is similar in function and behavior to the 
  8441. WinSendMsg()  function, in that it passes a synchronous message to the 
  8442. destination  window.  However, instead of accepting the handle of the 
  8443. destination  window as its first parameter, it accepts the handle of the 
  8444. control  window's parent and the window identifier of the control window itself 
  8445. as the first two parameters of the call.  For example, to send a  message of 
  8446. class EM_SETTEXTLIMIT to an entry field named EF_PRODNAME,  which is a child of 
  8447. the dialog box with handle hDlgBox, the function call shown in Figure 
  8448. "Communicating with a Control Window" is used. 
  8449.  
  8450. It is possible to perform an equivalent function using the WinSendMsg() call, 
  8451. by obtaining the control window's handle using the WinWindowFromID() function. 
  8452. However, for purposes of standardization and in accordance with emerging 
  8453. conventions, it is recommended that the WinSendDlgItemMsg() function be used to 
  8454. send messages to control windows.  Note that for this purpose, the definition 
  8455. of control  windows includes both the system menu and menu bar; messages sent 
  8456. to  these menus (in order to insert, modify or delete items) should be sent 
  8457. using the WinSendDlgItemMsg() function. 
  8458.  
  8459. Similarly, it is recommended that the WinSetDlgItemText() and 
  8460. WinQueryDlgItemText() functions be used to set and query the contents of 
  8461. control windows from within the application.  For example, assume that the user 
  8462. has completed interaction with a dialog box, and pressed the "Enter" or "OK" 
  8463. button, and the application wishes to obtain the contents of an entry field 
  8464. named EF_PRODNAME, which is child of the dialog box with  handle hDlgBox.  The 
  8465. function call call shown in Figure "Querying Information From a Control Window" 
  8466. is used. 
  8467.  
  8468. The WinQueryDlgItemText() function copies the contents of the entry field into 
  8469. the string szBuffer, and returns the number of characters copied. 
  8470.  
  8471. The WinSetDlgItemText() function is typically used in situations where some of 
  8472. the information necessary to complete an action is known; this information is 
  8473. then displayed in the appropriate entry fields within the dialog box, and the 
  8474. user fills in the missing fields.  Another use of this function is to provide 
  8475. default values for entry fields.  Both the WinSetDlgItemText() and 
  8476. WinQueryDlgItemText() functions are documented in the IBM OS/2 Version 2.0 
  8477. Presentation Manager Reference. 
  8478.  
  8479. List Boxes 
  8480.  
  8481. The complexity of communication with list boxes has been greatly reduced under 
  8482. OS/2 Version 2.0.  The Presentation Manager programming interface now includes 
  8483. a number of functions that allow most communication requirements to be achieved 
  8484. in a single step.  Note that these functions may also be used for communication 
  8485. with a combo box (prompted entry field). 
  8486.  
  8487. Insertion and deletion of list box items is carried out using the 
  8488. WinInsertLboxItem() and WinDeleteLboxItem() functions, which are new to OS/2 
  8489. Version 2.0.  The WinInsertLboxItem() function is illustrated in Figure 
  8490. "Inserting an Item Into a List Box". 
  8491.  
  8492. An application may obtain the text of a selected item in the list box using the 
  8493. WinQueryLboxSelectedItem() and WinQueryLboxItemText() functions.  The use of 
  8494. these functions is illustrated in Figure "Querying a Selected List Box Item". 
  8495.  
  8496. Other functions include the WinQueryLboxCount() function, which returns the 
  8497. number of items in a list box, and the WinQueryLboxItemTextLength() function, 
  8498. which returns the length of list box item's text. 
  8499.  
  8500. All of these list box manipulation functions are described in the IBM OS/2 
  8501. Version 2.0 Presentation Manager Reference. 
  8502.  
  8503.  
  8504. ΓòÉΓòÉΓòÉ 16.6.4. Message Boxes ΓòÉΓòÉΓòÉ
  8505.  
  8506. Communication between a window or dialog procedure and a message box  is 
  8507. relatively simple.  The message box is created and processed using  the 
  8508. WinMessageBox() function, and the only input data provided to this function is 
  8509. the title of the message box and the text of the message to be displayed.  The 
  8510. application may affect the style of the message box, by specifying style 
  8511. attributes in the function call, as described in the IBM OS/2 Version 2.0 
  8512. Presentation Manager Reference. 
  8513.  
  8514. An example of the WinMessageBox() function is given in Figure "WinMessageBox() 
  8515. Function". 
  8516.  
  8517. The result of the user's interaction with the message box (that is, the 
  8518. identifier of the button that was pressed) is communicated to the application 
  8519. in the form of an unsigned integer returned by the WinMessageBox() call.  The 
  8520. application may then interrogate this returned value to determine the 
  8521. subsequent action to be taken. 
  8522.  
  8523.  
  8524. ΓòÉΓòÉΓòÉ 16.6.5. Identifying the Destination Window ΓòÉΓòÉΓòÉ
  8525.  
  8526. When passing messages between windows using the WinPostMsg() or WinSendMsg() 
  8527. functions, the window handle of the destination window must be known and 
  8528. specified in the message.  If window handles are not defined globally, the 
  8529. required handle must be obtained from Presentation Manager.  This may be 
  8530. achieved in a number of ways: 
  8531.  
  8532.  If the target window has a known relationship to the current window  or to 
  8533.   another window for which the handle is already known, the WinQueryWindow() 
  8534.   function may be used to obtain the window handle of the target window. For 
  8535.   example, if a window wishes to post a message to its own parent window, the 
  8536.   technique shown in Figure "Obtaining a Window Handle - WinQueryWindow() 
  8537.   Function" may be used. 
  8538.  
  8539.   The WinQueryWindow() call returns the handle of the required  window. 
  8540.   Relationships other than parent/child may also be used by this function;  the 
  8541.   valid relationships are described, along with the WinQueryWindow() function, 
  8542.   in the IBM OS/2 Version 2.0 Presentation Manager Reference. 
  8543.  
  8544.  If the parent window and window identifier of the target window are known, 
  8545.   the WinWindowFromID() function may be used to obtain the window handle of the 
  8546.   target window. For example, if a window wishes to post a message to the 
  8547.   client window of its application's main window, assuming the frame window 
  8548.   handle is known, the method shown in Figure "Obtaining a Window Handle - 
  8549.   WinWindowFromID() Function" may be used. 
  8550.  
  8551.   The WinWindowFromID() function also returns the handle of the required 
  8552.   window. 
  8553.  
  8554.  If the target window is the application's main window, its handle may be 
  8555.   obtained by first querying the application's switch entry in the Workplace 
  8556.   Shell Window List to obtain the handle of the main frame window (using the 
  8557.   WinQuerySwitchHandle() and WinQuerySwitchEntry() functions), then using the 
  8558.   WinWindowFromID() function to obtain the handle of the client window, as 
  8559.   shown in Figure "Obtaining a Window Handle Using the Switch Entry". 
  8560.  
  8561.   The above example assumes that the application has been added to the OS/2 
  8562.   Window List using the WinAddSwitchEntry() function, and the handle of its 
  8563.   main frame window supplied as a parameter.  See Figure "WinAddSwitchEntry() 
  8564.   Function". 
  8565.  
  8566. When passing messages synchronously to control windows using the 
  8567. WinSendDlgItemMsg() function, it is generally assumed that the target control 
  8568. window is a child of the current window or dialog box.  Thus the parent window 
  8569. handle is the handle of the current window, and the window identifier is also 
  8570. known to the current window procedure.  An exception is the case where a window 
  8571. procedure wishes to send a message to a frame control of its own parent frame 
  8572. window.  In this case a WinQueryWindow() call must be issued with the QW_PARENT 
  8573. parameter to determine the handle of the frame window.  The WinSendDlgItemMsg() 
  8574. function may then be used with this handle and the window identifier of the 
  8575. required frame control. 
  8576.  
  8577.  
  8578. ΓòÉΓòÉΓòÉ 16.6.6. Creating Message Parameters ΓòÉΓòÉΓòÉ
  8579.  
  8580. Before a message can be passed to a target window, its message parameters must 
  8581. be created from the necessary data items.  As mentioned in Messages, message 
  8582. parameters are 32-bit fields.  Presentation Manager provides a number of macros 
  8583. to convert existing data types into the correct representation, and to extract 
  8584. data from message parameters within the target window procedure.  These macros 
  8585. are described in Table "Presentation Manager Macros". For example, to create 
  8586. message parameter mp1 composed of  two unsigned integers usInt1 and usInt2, the 
  8587. following statement is used: 
  8588.  
  8589. mp1 = MPFROM2SHORT(usInt1,usInt2);
  8590.  
  8591. Similarly, to extract two unsigned integers usInt3 and usInt4 from the message 
  8592. parameter mp2, the following statements are used: 
  8593.  
  8594. usInt3 = SHORT1FROMMP(mp2);
  8595. usInt4 = SHORT2FROMMP(mp2);
  8596.  
  8597. Characters, pointers, window handles, etc., may all be placed into and 
  8598. retrieved from message parameters using macros supplied by Presentation 
  8599. Manager. 
  8600.  
  8601.  
  8602. ΓòÉΓòÉΓòÉ 16.6.7. Broadcasting Messages ΓòÉΓòÉΓòÉ
  8603.  
  8604. In certain circumstances, a window procedure may wish to indicate an  event to 
  8605. multiple windows, and therefore need to pass the same message  to each of these 
  8606. windows.  Presentation Manager provides the capability for a message  to be 
  8607. broadcast to multiple windows with a single WinBroadcastMsg() function call. 
  8608.  
  8609. The WinBroadcastMsg() function passes a message of a specified class to the 
  8610. descendants of a specified parent window, as shown in Figure "WinBroadcastMsg() 
  8611. Function". 
  8612.  
  8613. The example shown in Figure "WinBroadcastMsg() Function" passes a message of 
  8614. the application-defined class WMP_MYMESSAGE to all children of the current 
  8615. window (that is, the window associated with the window procedure in which the 
  8616. function call is made), with message parameters as shown.  The message is 
  8617. posted to the target windows via a message queue, and is thus processed 
  8618. asynchronously; the WinBroadcastMsg() function also allows for synchronous 
  8619. processing using the BMSG_SEND flag. 
  8620.  
  8621. The parent/child hierarchy allows windows to be grouped in particular ways to 
  8622. suit application requirements.  For example, all the  object windows created by 
  8623. an application may be created as children of  a "dummy" master object window. 
  8624. If a particular message must then  be sent to all these object windows (for 
  8625. example, to close all the  windows), this can be done by broadcasting the 
  8626. message to all children  of the master object window. 
  8627.  
  8628. The BMSG_DESCENDANTS flag may be set in the WinBroadcastMsg() call to cause a 
  8629. message to be passed to all descendants of the specified parent window, rather 
  8630. than just the direct children of that parent.  This enables a message to be 
  8631. broadcast  to a wider target group, should the application so require. 
  8632. Alternatively, the BMSG_FRAMEONLY flag may be set, causing the message  to be 
  8633. passed only to frame windows.  This is useful in situations where  an 
  8634. application wishes to initiate an action by multiple display windows  at the 
  8635. same time. 
  8636.  
  8637. The WinBroadcastMsg() function must be used with caution,  particularly when it 
  8638. may cause messages to be sent to windows created  by other applications.  This 
  8639. is possible if the BMSG_DESCENDANTS flag  is set and the desktop window is 
  8640. specified as the parent, and may cause  complications in other applications. 
  8641. For example, consider the  following message definitions: 
  8642.  
  8643. Application 1
  8644.  
  8645. #define     WMP_REFRESH     WM_USER+12
  8646.  
  8647. Application 2
  8648.  
  8649. #define     WMP_CLOSEALL    WM_USER+12
  8650.  
  8651. In the example above, each application defines a message class, and each 
  8652. message is to be used for a different purpose.  However, both messages have the 
  8653. same message identifier.  Now let us assume that Application 1 makes the 
  8654. following function call: 
  8655.  
  8656. rc = WinBroadcastMsg(HWND_DESKTOP,
  8657.                      WMP_REFRESH,
  8658.                      mp1,
  8659.                      (MPARAM)0,
  8660.                      BMSG_POST);
  8661.  
  8662. This function call would cause a WMP_REFRESH message to be passed to all 
  8663. display windows in Application 1 and Application 2.  However, the windows in 
  8664. Application 2 would interpret the message as a WMP_CLOSEALL message, with 
  8665. possibly undesirable results. 
  8666.  
  8667. It is therefore strongly recommended that developers exercise extreme care in 
  8668. using the WinBroadcastMsg() function, in order to accurately determine the 
  8669. potential results of the messages being broadcast. 
  8670.  
  8671.  
  8672. ΓòÉΓòÉΓòÉ 16.7. Passing Control ΓòÉΓòÉΓòÉ
  8673.  
  8674. The use of functions and subroutines in an object-oriented application 
  8675. executing in the Presentation Manager raises some issues with regard to object 
  8676. boundaries.  In general, the scope of a function or subroutine should be 
  8677. restricted to a single application object, and the processing performed by that 
  8678. subroutine should therefore relate only to the data object(s) owned by that 
  8679. application object.  If a subroutine invoked from one application object will 
  8680. perform processing on a data object related to a different application object, 
  8681. then the subroutine should be invoked by the second  application object, by way 
  8682. of a message passed from the first application object. 
  8683.  
  8684. Four general types of subroutines may exist within an object-oriented 
  8685. application.  These are discussed in the following sections, and are classified 
  8686. according to the nature of their inputs and outputs. 
  8687.  
  8688.  
  8689. ΓòÉΓòÉΓòÉ 16.7.1. Direct Invocation/Direct Return ΓòÉΓòÉΓòÉ
  8690.  
  8691. This type of subroutine corresponds to the "conventional" subroutine call, in 
  8692. that a parameter list is passed to the subroutine from the calling routine, and 
  8693. a number of parameters and/or a return code is returned at the end of the 
  8694. subroutine's execution.  Within an object-oriented application, such 
  8695. subroutines should be used to perform processing that is limited in scope to a 
  8696. single application object (such as an SQL query on a database owned by the 
  8697. application object), or to perform a standard processing function that is 
  8698. common to a number of objects, but where the scope of each execution instance 
  8699. is limited to a single object.  For example, a function DrawCircle may be 
  8700. called by a number of window procedures to display a circular graphics 
  8701. primitive; however, each invocation of the function is from a single window 
  8702. procedure. 
  8703.  
  8704.  
  8705. ΓòÉΓòÉΓòÉ 16.7.2. Direct Invocation/Message Return ΓòÉΓòÉΓòÉ
  8706.  
  8707. This type of subroutine should be used where the scope of the processing 
  8708. performed by a subroutine is limited to a single application  object, but where 
  8709. the result of that processing must be communicated to  an application object 
  8710. other than the one that invoked the subroutine.  Since the conventional method 
  8711. of achieving communication between  objects is via messages, the subroutine 
  8712. posts a message to the affected  application object using the WinPostMsg() 
  8713. call, or  synchronously passes the message to the application object using the 
  8714. WinSendMsg() call (this latter call should be used with caution; see Message 
  8715. Invocation/Direct Return).  The message is routed to the destination window by 
  8716. Presentation Manager.  The subroutine typically returns to its caller in the 
  8717. normal fashion; this method of passing control is therefore merely a variation 
  8718. of the previously described Direct Invocation/Direct Return method. 
  8719.  
  8720. Assuming that the calling routine is a window procedure, the return code (if 
  8721. any) from the subroutine is passed to the calling window procedure and that 
  8722. procedure completes its execution before the message  resulting from the called 
  8723. subroutine is processed. 
  8724.  
  8725. Note that this technique can be used where the called subroutine executes in a 
  8726. secondary thread, and the resulting message is passed back to the calling 
  8727. window procedure in the primary thread to indicate the completion of the 
  8728. secondary thread's processing.  See Multitasking Considerations for further 
  8729. discussion of multiple threads. 
  8730.  
  8731.  
  8732. ΓòÉΓòÉΓòÉ 16.7.3. Message Invocation/Direct Return ΓòÉΓòÉΓòÉ
  8733.  
  8734. This type of subroutine occurs with window procedures that are invoked 
  8735. synchronously via a WinSendMsg() call.  The message is processed, and the 
  8736. return code from the window procedure is routed to the calling routine by 
  8737. Presentation Manager.  The calling routine then completes its execution.  If 
  8738. any queued messages are generated by the called window procedure or subroutine, 
  8739. these messages are not processed until the calling routine completes its 
  8740. execution and  the application issues its next WinGetMsg() call.  This is  so, 
  8741. even if the called window procedure or subroutine executes in a  separate 
  8742. thread. 
  8743.  
  8744. This type of invocation should be used for access to another application 
  8745. object, where the function to be performed must be executed  synchronously and 
  8746. the result returned directly to the caller.  However,  use of the WinSendMsg() 
  8747. call in preference to the  WinPostMsg() call for communication between objects 
  8748. may  result in messages being processed out of order due to the application 
  8749. pre-empting the normal order of execution determined by the message  queue. 
  8750. The WinSendMsg() function should thus be used with care.  The use of this call 
  8751. may also extend the time interval between successive WinGetMsg() calls to 
  8752. Presentation Manager, thus decreasing the application's responsiveness to user 
  8753. interaction. 
  8754.  
  8755.  
  8756. ΓòÉΓòÉΓòÉ 16.7.4. Message Invocation/Message Return ΓòÉΓòÉΓòÉ
  8757.  
  8758. This is the case for window procedures invoked in the standard way using a 
  8759. WinPostMsg() call from another window or using the WinDispatchMsg() function 
  8760. from the application's main routine.  In this case the message  is processed, 
  8761. and any messages generated during execution are posted to  the appropriate 
  8762. queue, but the return code from the window procedure is  passed only to 
  8763. Presentation Manager, and does not reach the calling window procedure. For this 
  8764. reason, it is important that any message that requires acknowledgement be 
  8765. handled in such a way that the window procedure generates a message that is 
  8766. routed to the calling window, and that contains the required acknowledgement. 
  8767.  
  8768. This type of invocation should be used for access to other application objects, 
  8769. where the function to be performed need not be performed synchronously, and 
  8770. where acknowledgement or completion of the  processing may be indicated by a 
  8771. subsequent message posted to the caller. 
  8772.  
  8773. Note that this should be the default method of invocation for window 
  8774. procedures, since the asynchronous nature of the processing allows the 
  8775. application to maintain the highest level of responsiveness to user 
  8776. interaction. 
  8777.  
  8778. Note also that a window may receive messages from a number of sources. This 
  8779. allows a window to service requests from a number of other windows, in 
  8780. accordance with a client-server architecture. This concept is discussed further 
  8781. in Client-Server Applications. 
  8782.  
  8783.  
  8784. ΓòÉΓòÉΓòÉ 16.7.5. External Macros ΓòÉΓòÉΓòÉ
  8785.  
  8786. An application may also pass control synchronously to an external routine such 
  8787. a macro or subprogram written using the Restructured Extended Executor (REXX) 
  8788. procedure language.  This can be achieved quite easily by calling the REXX 
  8789. command interpreter using the RexxStart() function from any point within the 
  8790. application.  This function is illustrated in Figure "Calling External Macros". 
  8791.  
  8792. Commands are passed to the REXX interpreter using command strings defined using 
  8793. the RXSTRING data type, which is defined in the rexxsaa.h header file.  This 
  8794. structure contains the string pointer and an unsigned long integer containing 
  8795. the length of the string in bytes.  A number of commands may be passed in a 
  8796. single operation, by specifying an array of RXSTRING structures in the second 
  8797. parameter to the RexxStart() function.  The first parameter specifies the 
  8798. number of commands being passed. 
  8799.  
  8800. The third parameter to the RexxStart() function defines the name of the REXX 
  8801. procedure to be invoked.  In Figure "Calling External Macros", the procedure is 
  8802. contained in the file REXXPROC, with an assumed default file extension of .CMD. 
  8803.  
  8804. If the REXX procedure invoked by the application issues its own commands such 
  8805. as SAY (to output information to the screen), a subcommand handler must be 
  8806. specified in the RexxStart() function call, in order to trap such output.  A 
  8807. subcommand handler is simply a subroutine which accepts, as parameters, the 
  8808. function and subfunction names issued by the REXX procedure, along with a 
  8809. pointer to an RXSTRING structure which may be used by the subcommand handler to 
  8810. return any information to the REXX procedure. A subcommand handler may reside 
  8811. within the application's main executable module or in a DLL, and must be 
  8812. registered prior to issuing the RexxStart() function call, using the 
  8813. RexxRegisterSubcomExe() or RexxRegisterSubcomDll() functions. 
  8814.  
  8815. The REXX interpreter's operating environment may be customized through the use 
  8816. of user exits, whereby special routines may be inserted at particular points in 
  8817. the interpreter's execution.  Such routines are specified using an array of 
  8818. RXSYSEXIT structures, which identify the exit point and the entry point address 
  8819. of the routine to be invoked at that point.  The address of this array is 
  8820. passed in the RexxStart() function call. 
  8821.  
  8822. Use of the REXX interpreter, the RexxStart() function and its supporting 
  8823. functions are described in detail in the IBM OS/2 Version 2.0 Technical Library 
  8824. - Procedures Language/2 REXX Reference. 
  8825.  
  8826.  
  8827. ΓòÉΓòÉΓòÉ 16.8. Terminating an Application ΓòÉΓòÉΓòÉ
  8828.  
  8829. A Presentation Manager application is normally terminated by a message of the 
  8830. class WM_QUIT being posted to the application's message queue.  The message may 
  8831. be posted by any window procedure or subroutine within the application, or by 
  8832. Presentation Manager as the result of the user selecting the "Shutdown" option 
  8833. from the Presentation Manager desktop.  The message may result  from the user 
  8834. selecting an "Exit" option from the menu bar, or  selecting the "Close" option 
  8835. in the system menu of the application's main window. 
  8836.  
  8837. The WM_QUIT message causes the next WinGetMsg() call to return FALSE.  This in 
  8838. turn causes the application's message processing loop to terminate. 
  8839.  
  8840. By convention, a Presentation Manager application performs standard termination 
  8841. processing such as: 
  8842.  
  8843.  Destroying the application's main window 
  8844.  
  8845.  Destroying the application's message queue 
  8846.  
  8847.  Deregistering the application from Presentation Manager. 
  8848.  
  8849. The application may additionally perform its own termination functions such as 
  8850. closing or destroying any global data objects.  Secondary threads are normally 
  8851. terminated from within the window procedure that created them, as part of that 
  8852. window procedure's WM_DESTROY message processing.  See Multitasking 
  8853. Considerations for further information. 
  8854.  
  8855.  
  8856. ΓòÉΓòÉΓòÉ 16.9. Summary ΓòÉΓòÉΓòÉ
  8857.  
  8858. It can be seen that by making effective use of the facilities provided by 
  8859. Presentation Manager, and by following a number of simple guidelines in the 
  8860. design and implementation of applications, it is relatively simple to develop a 
  8861. Presentation Manager application that conforms to module-based object-oriented 
  8862. programming standards, and achieves benefits through reduced development effort 
  8863. and easier application maintenance, due to code reuse and encapsulation. 
  8864.  
  8865. It must be accepted however, that some deviation from strict object-oriented 
  8866. practice may be necessary in order to preserve other important goals such as 
  8867. the preservation of responsiveness to the end user. Adherence to academic 
  8868. principles should not take precedence over achievement of the required result. 
  8869.  
  8870. The mapping of data objects into application objects must be approached with 
  8871. great care in the design stage of a Presentation Manager application. 
  8872. Presentation Manager allows the creation of window procedures (application 
  8873. objects) that operate on more than one data object, and of multiple window 
  8874. procedures that operate on the same data object.  This practice should be 
  8875. discouraged however, since it reduces the level  of encapsulation in the 
  8876. application object, increases the interdependence between application objects, 
  8877. and consequently reduces the benefits attainable through code reuse and 
  8878. containment of change. 
  8879.  
  8880. Notwithstanding, the Presentation Manager environment affords great opportunity 
  8881. for the development of applications that implement the general principles of 
  8882. the object-oriented approach.  A central precept of object-oriented design is 
  8883. the generic nature and consequent reusability  of the objects so created. 
  8884. Adherence to guidelines that promote conformance to object-oriented concepts 
  8885. such as data abstraction, encapsulation and polymorphism, in conjunction with 
  8886. the facilities  provided by Presentation Manager for object creation, 
  8887. communication and subclassing, and by the OS/2 operating system in the form of 
  8888. dynamic linking, facilitates the development of highly granular, reusable 
  8889. generic objects in the Presentation Manager environment. 
  8890.  
  8891.  
  8892. ΓòÉΓòÉΓòÉ 17. Workplace Shell and the System Object Model ΓòÉΓòÉΓòÉ
  8893.  
  8894. The Workplace Shell provided under OS/2 Version 2.0 introduces an 
  8895. object-oriented layer into the Presentation Manager environment.  It provides a 
  8896. mechanism for the registration of object classes, creation of objects within 
  8897. those classes, and the inheritance of characteristics and behaviors from 
  8898. existing object classes.  Using the Workplace Shell, an application may be 
  8899. created as a series of objects that interact on the desktop, and which the user 
  8900. manipulates to perform the required application processing.  Each object 
  8901. possesses data, which may be defined for the entire class or for each instance, 
  8902. and a set of methods that operate upon that data. 
  8903.  
  8904. The Workplace Shell functions that allow the creation and manipulation of 
  8905. objects are based upon the system object model, which establishes a basic 
  8906. inheritance hierarchy for objects in the system and defines the underlying 
  8907. protocols which regulate the relationships between objects.  The concepts 
  8908. behind the system object model are described in detail in OS/2 Version 2.0 - 
  8909. Volume 3:  Presentation Manager and Workplace Shell. 
  8910.  
  8911.  
  8912. ΓòÉΓòÉΓòÉ 17.1. Objects in the Workplace Shell ΓòÉΓòÉΓòÉ
  8913.  
  8914. An object in the Workplace Shell conforms closely to the definition of an 
  8915. application object given in The Presentation Manager Application Model, in that 
  8916. it consists of a set of data and a number of methods that operate upon that 
  8917. data.  Each Workplace Shell object is an instance of a particular object class. 
  8918. In accordance with normal object-oriented theory, the class defines the basic 
  8919. characteristics of the object and the way in which the object responds to 
  8920. events. 
  8921.  
  8922.  
  8923. ΓòÉΓòÉΓòÉ 17.1.1. Inheritance Hierarchy ΓòÉΓòÉΓòÉ
  8924.  
  8925. Each object class is descended from another class, known as its parent class. 
  8926. Since the system object model supports the object-oriented concept of 
  8927. inheritance, a class may inherit data and methods from its parent class, which 
  8928. in turn may inherit data and methods from its parent, and so on.  A class which 
  8929. inherits properties from other classes is therefore known as a descendant of 
  8930. those classes, and the classes from which it inherits are known as ancestors. 
  8931. The implementation of inheritance in the Workplace Shell means that when 
  8932. creating a new object class, a programmer simply subclasses the parent class, 
  8933. and need only define those characteristics that are not defined by, or are 
  8934. different from those of the parent class.  This greatly simplifies the process 
  8935. of creating a new object class. 
  8936.  
  8937. Under the system object model, every object class is a descendant of the base 
  8938. class SOMObject.  This class defines the basic characteristics and behaviors 
  8939. common to all objects in the system.  Other object classes are subclasses of 
  8940. this class.  The system object model provides two additional classes, SOMClass 
  8941. and SOMClassManager, to form the basis of an inheritance hierarchy. The 
  8942. Workplace Shell extends this hierarchy by creating a number of classes of its 
  8943. own, based upon the SOMObject class. These Workplace Shell object classes 
  8944. define the characteristics of the object types that are defined and implemented 
  8945. by the Workplace Shell itself. 
  8946.  
  8947. The inheritance hierarchy implemented by the Workplace Shell is illustrated in 
  8948. Figure "Workplace Shell Inheritance Hierarchy". 
  8949.  
  8950. As well as being descended from the system object model base inheritance 
  8951. hierarchy, all Workplace Shell object classes are descended from one of three 
  8952. base storage classes defined by the Workplace Shell. These classes are so named 
  8953. because they directly influence the storage of control information and instance 
  8954. data for the class.  The three predefined base storage classes are: 
  8955.  
  8956.  WPAbstract, which is the base class for abstract objects such as programs, 
  8957.   devices, etc., and for which control information is stored in the system 
  8958.   initialization file OS2.INI 
  8959.  
  8960.  WPFileSystem, which is the base class for objects that are stored as files in 
  8961.   the file system, and for which control information is stored in the file 
  8962.   system as extended attributes 
  8963.  
  8964.  WPTransient, which is the base class for objects that only exist during 
  8965.   execution of a particular program; that is, the object is created and used 
  8966.   for a particular purpose during processing, and then immediately deleted from 
  8967.   the system. 
  8968.  
  8969. An application developer may extend the Workplace Shell inheritance hierarchy 
  8970. by introducing new object classes based upon those already implemented by the 
  8971. Workplace Shell itself.  Indeed, the developer may even introduce new base 
  8972. classes, although this is definitely a non-trivial exercise and should be 
  8973. approached with caution. 
  8974.  
  8975.  
  8976. ΓòÉΓòÉΓòÉ 17.1.2. Metaclasses ΓòÉΓòÉΓòÉ
  8977.  
  8978. Just as each Workplace Shell object is an instance of a class, the class itself 
  8979. is an instance of another class known as its metaclass. Just as an object has 
  8980. instance data and methods that pertain only to a specific instance of the 
  8981. class, so the metaclass has class data and methods that pertain to the entire 
  8982. class.  Such methods are known as class methods, whereas methods that operate 
  8983. only for a particular instance of the class are known as instance methods. 
  8984.  
  8985. Class methods and data are available to the programmer when creating new object 
  8986. classes.  A programmer may introduce new class data and methods for an object 
  8987. class, as well as instance data and methods.  Similarly, a new object class may 
  8988. override existing class methods to modify the processing performed by those 
  8989. methods. 
  8990.  
  8991.  
  8992. ΓòÉΓòÉΓòÉ 17.1.3. Class Implementation ΓòÉΓòÉΓòÉ
  8993.  
  8994. Each object class in the Workplace Shell resides in a dynamic link library. A 
  8995. programmer creates an object class by defining its characteristics in a class 
  8996. definition file. This file is then used as input to the SOM Precompiler, in 
  8997. order to produce "C" source code and header files for the object class. This 
  8998. source code includes basic definitions for the object class's data and methods; 
  8999. the code is then edited by the programmer to include the logic for each of the 
  9000. required methods.  Once the code is complete, it is compiled and link edited in 
  9001. the normal way to produce a dynamic link library; see Compiling and Link 
  9002. Editing an Application for further information on compiling and link editing. 
  9003.  
  9004. When an object class has been created, it must be registered with the Workplace 
  9005. Shell, which includes the DLL in a list of libraries loaded at initialization 
  9006. time.  The entry points for the DLL are known to the Workplace Shell, and may 
  9007. be called in order to invoke the object's methods. 
  9008.  
  9009. The process of creating an object class from a class definition file is 
  9010. described in Defining an Object. 
  9011.  
  9012.  
  9013. ΓòÉΓòÉΓòÉ 17.2. Object Structure ΓòÉΓòÉΓòÉ
  9014.  
  9015. In the simplest case, an object in the Workplace Shell consists of methods and 
  9016. instance data. The Workplace Shell communicates events to the object using 
  9017. messages, which in turn invoke the object's methods to perform the processing 
  9018. indicated by the event.  This is in accordance with the definition of an 
  9019. application object given in The Presentation Manager Application Model.  Note 
  9020. that since the Workplace Shell provides a more extensive inheritance hierarchy 
  9021. than the base Presentation Manager application model, the method invoked by a 
  9022. particular message may belong explicitly to the object in question, or may 
  9023. belong to its parent (and be inherited from that parent). 
  9024.  
  9025. The structure of an object in the Workplace Shell is therefore very similar to 
  9026. that of a window in the conventional Presentation Manager application model; 
  9027. the Workplace Shell object simply takes the object-oriented concepts to a 
  9028. higher degree of implementation.  The constructs implemented by Presentation 
  9029. Manager under previous versions of OS/2 can, therefore, often be implemented 
  9030. more elegantly with the Workplace Shell. 
  9031.  
  9032. For the remainder of this chapter, an example will be used to explain the 
  9033. structure and behavior of an object class.  The example used is that of a 
  9034. specific type of Workplace Shell folder, which has a password defined so that 
  9035. it can be locked to prevent access by an unauthorized user.  This object class 
  9036. is implemented by subclassing the WPFolder class to create a new object class 
  9037. named PWFolder, adding new methods and overriding existing methods where 
  9038. appropriate.  Sample code is provided in the text for the various methods used 
  9039. to add the password protection to the folder. 
  9040.  
  9041.  
  9042. ΓòÉΓòÉΓòÉ 17.2.1. Methods ΓòÉΓòÉΓòÉ
  9043.  
  9044. In a Presentation Manager application, a window procedure receives messages 
  9045. from Presentation Manager, determines the type of message and invokes a series 
  9046. of program statements (which effectively constitute a method) as a result of 
  9047. that message.  A Workplace Shell object operates in a similar fashion, except 
  9048. that the Workplace Shell itself determines the type of message and invokes the 
  9049. corresponding method, without any explicit action on the part of the object. 
  9050.  
  9051. Therefore, whereas the Presentation Manager window procedure comprises a case 
  9052. statement with each case being a method, the Workplace Shell object eliminates 
  9053. the need for the case statement and allows the Workplace Shell to invoke the 
  9054. methods directly.  The syntax for invoking a method from within an object or 
  9055. application is hence very similar to that for invoking a subroutine;  the only 
  9056. real difference is that a method may be accessed from outside the object itself 
  9057. (that is, from another object or from an application), while a subroutine is 
  9058. normally private to the object. 
  9059.  
  9060. Many methods are defined by the WPObject class, from which application-defined 
  9061. classes are typically descended.  When creating a new object class, a 
  9062. programmer may override the methods already defined by the class's ancestors, 
  9063. and/or include new methods specific to the class being created.  The methods 
  9064. defined by the WPObject class are described in the IBM OS/2 Version 2.0 
  9065. Presentation Manager Reference.  Programmers who wish to create new object 
  9066. classes descended from this case should read the descriptions of these methods 
  9067. to determine the extent of the modifications necessary. 
  9068.  
  9069. Invoking a Method 
  9070.  
  9071. As mentioned in The Presentation Manager Application Model, methods within an 
  9072. object are invoked as a result of messages that communicate events to the 
  9073. object.  These events may be initiated by the user (for example, as a result of 
  9074. clicking the mouse on an object's context menu), by the object itself or 
  9075. another object, or by the system to indicate a system event such as opening or 
  9076. closing a view of the object. 
  9077.  
  9078. The syntax for invoking a method is similar to that for invoking a subroutine, 
  9079. with the exception that since a method is invoked by the Workplace Shell, the 
  9080. first parameter passed in the call is therefore not a parameter used by the 
  9081. method, but a pointer to an object that is capable of invoking the method; this 
  9082. is typically a pointer to the object itself.  This is illustrated in Figure 
  9083. "Invoking a Method", where a sample invocation of a method named _wpSetTitle is 
  9084. shown. 
  9085.  
  9086. The _wpSetTitle method is defined by the WPObject class, and is inherited by 
  9087. all classes descended from the class.  The method accepts a title string and 
  9088. sets the title of the object; that is, the text that appears below the object's 
  9089. icon on the Workplace Shell desktop. 
  9090.  
  9091. The pointer somSelf is defined by the SOM Precompiler when it creates the "C" 
  9092. source code from the class definition file.  In the example above, somSelf is 
  9093. defined as a pointer to an object of class PWFolder and within a method, allows 
  9094. the method to access the instance data of the object to which it belongs.  The 
  9095. need to pass this pointer arises from the limitations of the "C" language 
  9096. syntax under which the current implementation of the Workplace Shell operates; 
  9097. other languages such as C++ may be able to invoke methods in a more elegant 
  9098. manner. 
  9099.  
  9100. Method Processing and Instance Data 
  9101.  
  9102. Within a method, the somSelf pointer, passed as the first parameter in the call 
  9103. to the method, acts as a pointer to the method's own object, and allows the 
  9104. method to access its instance data.  The SOM Precompiler automatically provides 
  9105. a base pointer named somThis that references the instance data, and includes a 
  9106. call to a method that initializes this pointer from the object pointer: 
  9107.  
  9108. PWFolderData *somThis = PWFolderGetData(somSelf);
  9109.  
  9110. When this statement has successfully executed upon entry to the method, the 
  9111. method has access to the object's instance data.  For example, the 
  9112. password-protected folder has a password string, which may be accessed by a 
  9113. method using the following name: 
  9114.  
  9115. somThis->szPassword
  9116.  
  9117. To make things simpler, the SOM Precompiler generates a macro for each instance 
  9118. variable, in a manner similar to that used for function names: 
  9119.  
  9120.    #define _szPassword (somThis->szPassword)
  9121.    #define _szCurrentPassword (somThis->szCurrentPassword)
  9122.    #define _szUserid (somThis->szUserid)
  9123.  
  9124. This macro is included in a header file for the object class, and avoids the 
  9125. need for the programmer to type the complete name throughout the source code. 
  9126.  
  9127. Once the instance data is available to the method, any application logic may be 
  9128. performed, including the use of OS/2 and Presentation Manager resources.  See 
  9129. Accessing Presentation Manager Resources From a Workplace Shell Object for 
  9130. additional considerations on the use of Presentation Manag er resources from 
  9131. within a Workplace Shell object. 
  9132.  
  9133. Returning from a Method 
  9134.  
  9135. In order to return control to its calling routine, a method simply uses the 
  9136. return statement.  Any valid form of return code may be passed to the calling 
  9137. routine as a parameter to this statement, provided that the data type of the 
  9138. return code is consistent with the declaration of the method. The data type of 
  9139. the return code is typically set by the SOM Precompiler, and a default return 
  9140. statement provided, based on information supplied by the programmer when the 
  9141. method is defined in the Methods section of the class definition file (see 
  9142. Class Definition File). 
  9143.  
  9144. Overriding Existing Methods 
  9145.  
  9146. A new object class may override one or more of the existing methods defined by 
  9147. its parent class, either to completely replace the processing performed by 
  9148. these methods, or to add its own processing to that already performed by the 
  9149. parent.  An example of an object class overriding the _wpSetTitle method is 
  9150. shown in Figure "Overriding an Existing Method". 
  9151.  
  9152. The example given in Figure "Overriding an Existing Method" shows the use of 
  9153. class-specific processing to modify the title of a password-protected folder. 
  9154. The inclusion of the string "<LOCKED>" at the end of the user-specified title 
  9155. provides a visual indication to the user that the folder is locked.  Additional 
  9156. visual indication is provided by modifying the icon when the folder is in the 
  9157. locked state; the code that carries out this operation is included in the 
  9158. _LockFolder method shown in Figure "Adding a New Method". 
  9159.  
  9160. The strings _szCurrentPassword and _szPassword are instance data items defined 
  9161. by the new object class.  These data items are actually accessed using the 
  9162. somThis pointer; however, the SOM Precompiler defines a macro for each instance 
  9163. data item, as described in Method Processing and Instance Data above. 
  9164.  
  9165. Note that the default processing supplied by the parent class is invoked at the 
  9166. end of the class-specific processing.  For all but the most exceptional 
  9167. circumstances, default processing should be allowed to occur in order to ensure 
  9168. that the normal behavior of the object class is preserved. 
  9169.  
  9170. Adding New Methods 
  9171.  
  9172. In addition to overriding existing methods defined by the parent class, an 
  9173. object class may also add new methods to carry out processing for events not 
  9174. handled by the parent class.  For example, the password-protected folder 
  9175. example must have a mechanism to lock the folder.  This is implemented as a new 
  9176. method named _LockFolder, as shown in Figure "Adding a New Method". 
  9177.  
  9178. This method simply copies a default string to the variable _szCurrentPassword 
  9179. that contains the last supplied password entry from the user, so that when a 
  9180. comparison is made between this variable and the folder's password, the two do 
  9181. not match.  This effectively locks the folder and prevents any view of it being 
  9182. opened.  To provide a visual indication to the end user that the folder is 
  9183. locked, a "locked" icon is loaded using the Presentation Manager 
  9184. WinLoadPointer() function, and the _wpSetIcon method is invoked to set this as 
  9185. the folder's new icon on the desktop. 
  9186.  
  9187. Note that the definition for adding a new method is very similar to that for 
  9188. overriding an existing method.  The primary difference is that, since the new 
  9189. method is specific to the object class and is not defined by the parent class, 
  9190. there is no need to invoke the parent class's method to perform default 
  9191. processing for the method. 
  9192.  
  9193. Attaching a Method to the Context Menu 
  9194.  
  9195. A method may be invoked as a result of the user selecting an item from the 
  9196. object's context menu.  In order to allow this, an item must be added to the 
  9197. context menu, and an appropriate action must be taken by the object when that 
  9198. item is selected by the user. 
  9199.  
  9200. An item can be added to the context menu for an object class by overriding the 
  9201. _wpModifyPopupMenu method defined by the WPObject class, and including a call 
  9202. to the _wpInsertPopupMenuItems method to insert the item.  This technique is 
  9203. shown in Figure "Adding an Item to a Context Menu". 
  9204.  
  9205. The example shown in Figure "Adding an Item to a Context Menu" adds a Lock item 
  9206. to the context menu for the password-protected folder object.  This allows the 
  9207. folder to be locked by the user at any time, irrespective of whether a view of 
  9208. the folder is currently open. 
  9209.  
  9210. The _wpInsertPopupMenuItems method adds a menu item or a submenu to the 
  9211. existing context menu for the object.  The item identifier for the menu item or 
  9212. submenu (MI_LOCK in the above example) is an integer constant that is typically 
  9213. defined in the header file.  Note that the value of this constant should be 
  9214. specified as an offset from the system-defined constant WPMENUID_USER, rather 
  9215. than an absolute integer value.  Following this convention will avoid any 
  9216. clashes with item identifiers defined by the Workplace Shell for default 
  9217. context menu items. 
  9218.  
  9219. Since the password-protected folder is a descendant of the WPFolder class 
  9220. defined by the Workplace Shell, the default context menu items for the WPFolder 
  9221. class should also appear.  The default processing for the parent class is 
  9222. therefore invoked as part of the _wpModifyPopupMenu processing for the new 
  9223. object class. 
  9224.  
  9225. Once the required item is added to the context menu, the object must be able to 
  9226. detect when the item is selected in order to invoke the appropriate method.  By 
  9227. default, the _wpMenuItemSelected method is invoked by the system whenever the 
  9228. user selects an item from the context menu.  This method, which is defined by 
  9229. the WPObject class, may be overridden by a new object class in order to check 
  9230. for the presence of a new item and invoke the appropriate method.  The item 
  9231. identifier of the selected item is passed as a parameter to the 
  9232. _wpMenuItemSelected method, and is normally interrogated using a case 
  9233. statement, as shown in Figure "Invoking a Method via a Context Menu Item". 
  9234.  
  9235. The _wpMenuItemSelected method consists of a case statement that determines the 
  9236. item selected from the context menu.  In the above example, an explicit case is 
  9237. included only for the MI_LOCK item defined by this class.  All other menu items 
  9238. are defined by the parent class, and their selection is therefore handled by 
  9239. allowing the parent class's default processing to occur. 
  9240.  
  9241. Class Methods 
  9242.  
  9243. Most object methods are instance methods; that is, they act upon one particular 
  9244. instance of an object class, rather than upon all instances of the class. 
  9245.  
  9246. However, there are times when it is useful to have methods that operate on the 
  9247. object class itself.  These methods may operate on class data rather than 
  9248. instance data, thereby affecting the entire class rather than a single instance 
  9249. of the class.  Such methods are known as class methods.  The class method 
  9250. _wpclsQueryTitle is defined by the WPObject class, and is overridden in the 
  9251. password-protected folder example.  An example of the overridden 
  9252. _wpclsQueryTitle method is given in Figure "Class Method Example". 
  9253.  
  9254. The purpose of this class method is to provide the password-protected folder 
  9255. with a default title.  This is the title that will appear with the folder's 
  9256. template icon in the Templates folder, and which is given to any instances of 
  9257. the class that are instantiated without a title.  Since the default title 
  9258. applies to all instances of the class, it is implemented in a class method 
  9259. rather than an instance method. 
  9260.  
  9261. The prefix "M_" denotes the metaclass in the SOM-generated "C" source.  As 
  9262. already mentioned, the first parameter passed to a method is a pointer to a 
  9263. type of object that can invoke that method; this is true for both instance 
  9264. methods and class methods; for a class method the first parameter contains a 
  9265. pointer to an instance of the metaclass. 
  9266.  
  9267.             Pointer to instance of metaclass
  9268.             which is a class object ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9269.                                              
  9270.    pwfoldercls_wpclsQueryTitle(M_PWFolder *somSelf)
  9271.                                   
  9272.         Type is Metaclass ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9273.  
  9274. Since a class is also an object, it follows that the class itself has its own 
  9275. "instance data"; hence the next line of code appears as follows: 
  9276.  
  9277.     /* M_PWFolderData *somThis = M_PWFolderGetData(somSelf); */
  9278.  
  9279. This statement would access the SOM object's class data.  However, since no 
  9280. class data is specified in the .CSC file, there is nothing to access and so the 
  9281. SOM Precompiler has commented the line out to reflect this. 
  9282.  
  9283. For simple examples, it is easier to use global variables in the DLL for class 
  9284. data.  This technique has been used in Figure "Class Method Example"; the 
  9285. default title string is stored at the beginning of the program into the global 
  9286. variable szDefaultTitle.  However, using this technique means that class data 
  9287. can be accessed by instance methods, which is never desirable, and may have 
  9288. adverse consequences, although these may generally be avoided by sound 
  9289. programming techniques. 
  9290.  
  9291. Invoking Another Object's Methods 
  9292.  
  9293. An object may invoke a method in another object class.  This technique is 
  9294. useful in a client-server situation, where one object creates another object of 
  9295. a different class and then wishes to have that object perform certain actions. 
  9296. The system object model provides programming functions that can be used to 
  9297. determine the necessary information and invoke the method.  An example is given 
  9298. in Figure "Invoking a Method in Another Object Class". 
  9299.  
  9300. The example given in Figure "Invoking a Method in Another Object Class" shows 
  9301. part of a "database client" object that sends a database query to a "database 
  9302. server" object.  The client first allocates a shared memory object into which 
  9303. it loads the query.  The client then uses the _somFindClass method and the 
  9304. SOM_IdFromString macro to determine the object pointer for the object, and the 
  9305. method identifier for the required method. The _somDispatchL method is then 
  9306. used to invoke the method. 
  9307.  
  9308. It is also possible to invoke a class method using the object pointer to that 
  9309. class, obtained using the _somFindClass method shown in Figure "Invoking a 
  9310. Method in Another Object Class".  This requires the header file for the class 
  9311. to be included in the source code for the class that will invoke the method, 
  9312. using a #include statement.  In the module definition file for the invoking 
  9313. class, the following IMPORT statements must be provided: 
  9314.  
  9315.         IMPORTS
  9316.            record.RecordCClassData
  9317.            record.RecordClassData
  9318.            record.RecordNewClass
  9319.            record.M_RecordCClassData
  9320.            record.M_RecordClassData
  9321.            record.M_RecordNewClass
  9322.  
  9323. When these steps have been carried out, a method in the other class may be 
  9324. invoked directly, as follows: 
  9325.  
  9326. _clsQueryDatabase(RecordClass,         /* Invoke class method   */
  9327.                   pQuery,              /* Method specific       */
  9328.                   Folder);             /* parameters            */
  9329.  
  9330. While this technique is less clean than the previous approach since it requires 
  9331. the inclusion of the header file and import statements, it provides better 
  9332. performance. 
  9333.  
  9334.  
  9335. ΓòÉΓòÉΓòÉ 17.2.2. Subroutines ΓòÉΓòÉΓòÉ
  9336.  
  9337. Subroutines may be accessed from within a Workplace Shell object, in much the 
  9338. same manner as from any other program.  Normal programming language calling 
  9339. conventions are used.  Subroutines used by the object may reside within the 
  9340. same DLL as the object itself, or may be in a different DLL. 
  9341.  
  9342. A number of guidelines for the use of subroutines within Presentation Manager 
  9343. applications are given in The Presentation Manager Application Model.  Note 
  9344. that similar guidelines apply to the use of subroutines within Workplace Shell 
  9345. objects, since these objects should also adhere to object-oriented programming 
  9346. principles. 
  9347.  
  9348.  
  9349. ΓòÉΓòÉΓòÉ 17.3. Defining an Object ΓòÉΓòÉΓòÉ
  9350.  
  9351. The definition of an object is achieved using a language known as the Object 
  9352. Interface Definition Language. The statements that define an object class are 
  9353. entered into the class definition file for the class, which is an ASCII file 
  9354. and may thus be created using any normal text editor.  The class definition 
  9355. file is used as input to the SOM Precompiler, which will generate a number of 
  9356. files from the class definition file. 
  9357.  
  9358.  
  9359. ΓòÉΓòÉΓòÉ 17.3.1. Files ΓòÉΓòÉΓòÉ
  9360.  
  9361. The SOM Precompiler generates a number of files that are used to define an 
  9362. object class to the Workplace Shell and to other classes that may wish to 
  9363. inherit the characteristics and behaviors of the class.  These files are: 
  9364.  
  9365. .H     A public header file for programs that use the class. 
  9366.  
  9367. .PH    A private header file, which provides usage bindings to any private 
  9368.        methods implemented by the class. 
  9369.  
  9370. .IH    An implementation header file, which provides macros, etc., to support 
  9371.        the implementation of the class. 
  9372.  
  9373. .C     A template C file, to which code may be added to implement the class. 
  9374.  
  9375. .SC    A language-neutral class definition. 
  9376.  
  9377. .PSC   A private language-neutral core file, which contains private parts of 
  9378.        the interface for the class. 
  9379.  
  9380. .DEF   An OS/2 DLL module definition file containing the relevant exports need 
  9381.        to implement the class. 
  9382.  
  9383. These files may then be used as input to a C compiler, generating object code 
  9384. that is in turn linked to create a dynamic link library, which implements the 
  9385. object class. 
  9386.  
  9387.  
  9388. ΓòÉΓòÉΓòÉ 17.3.2. Class Definition File ΓòÉΓòÉΓòÉ
  9389.  
  9390. The class definition file contains all the information necessary to implement a 
  9391. new class.  The file is divided into the following sections: 
  9392.  
  9393.  1. Include section 
  9394.  
  9395.  2. Class section 
  9396.  
  9397.  3. Parent Class section 
  9398.  
  9399.  4. Release Order section 
  9400.  
  9401.  5. Metaclass section 
  9402.  
  9403.  6. Passthru section 
  9404.  
  9405.  7. Data section 
  9406.  
  9407.  8. Methods section. 
  9408.  
  9409. Each of these sections is described in more detail below, using examples from 
  9410. the password-protected folder class described earlier in this chapter. 
  9411.  
  9412. Include Section 
  9413.  
  9414. Since all system object model classes have a parent, it is necessary to know 
  9415. the name of the parent class and the location of its interface definition.  The 
  9416. include section specifies the location of the interface definition file for the 
  9417. parent.  In the folder example, only a single line is included: 
  9418.  
  9419. #
  9420. # Include the class definition file for the parent class
  9421. #
  9422. include <wpfolder.sc>
  9423.  
  9424. Since the folder example is simply a specialized form of the WPFolder class, it 
  9425. uses this class as its parent and inherits much of its behavior from the 
  9426. WPFolder class.  The include section therefore specifies the interface 
  9427. definition for the WPFolder class.  A full list of Workplace Shell classes and 
  9428. their definition files can be found in the IBM OS/2 Version 2.0 Presentation 
  9429. Manager Reference. 
  9430.  
  9431. Note that the comments that start with a "#" are discarded by the SOM 
  9432. Precompiler; hence the comment in the example above will not be seen in the SOM 
  9433. Precompiler-generated files. 
  9434.  
  9435. Class Section 
  9436.  
  9437. This section provides basic information about the new class, specifying its 
  9438. name and various attributes.  The password folder example has the following 
  9439. class section entry: 
  9440.  
  9441. #
  9442. #   Define the new class
  9443. #
  9444. class: PWFolder,
  9445.        file stem = pwfolder,
  9446.        external prefix = pwFolder_,
  9447.        class prefix = pwFoldercls_,
  9448.        major version = 1,
  9449.        minor version = 1,
  9450.        local;
  9451. -- PWFolder is a Password-protected folder.
  9452. -- Its derived as follows:
  9453. --        SOMOject
  9454. --          - WPObject
  9455. --             - WPFileSystem
  9456. --                - WPFolder
  9457. --                   - PWFolder
  9458.  
  9459. All class definition files must contain a class section.  Certain statements 
  9460. within the class section are mandatory, while others are optional. 
  9461.  
  9462. The first item in the class section is a name: 
  9463.  
  9464. class: PWFolder,
  9465.  
  9466. All classes must have a name. 
  9467.  
  9468. The file stem specifies the file name to be used by the SOM Precompiler for the 
  9469. generated files. For example, if the file stem statement reads: 
  9470.  
  9471. file stem = myfile
  9472.  
  9473. then the .DEF file generated by the SOM Precompiler would be called myfile.def. 
  9474.  
  9475. The external prefix specifies a prefix to be used by the SOM Precompiler on all 
  9476. function names.  Hence if an external prefix of "pwFolder_" is specified and a 
  9477. method is named "SetInfo", the function name generated by the SOM Precompiler 
  9478. would be "pwFolder_SetInfo". 
  9479.  
  9480. The SOM Precompiler normally generates a macro for all methods defined by the 
  9481. class, such that the method is referenced in the source code by its defined 
  9482. name, preceded by an underscore character.  For example, the method 
  9483. pwFolder_SetInfo described above would be referenced simply as _SetInfo. This 
  9484. helps make the source code more readable and avoids the need for the programmer 
  9485. to type the full name when editing the code. 
  9486.  
  9487. The class prefix is similar to the external prefix, except that it is used 
  9488. specifically for functions that are class methods.  The differences between 
  9489. class methods and instance methods are discussed in Methods (Class Methods). 
  9490.  
  9491. The major version and minor version are used to ensure that the bindings are at 
  9492. the right level for the class implementation code. 
  9493.  
  9494. The local option is used to specify that binding files should be linked 
  9495. locally.  In " C" programming terms, this means that the following source code 
  9496. is generated: 
  9497.  
  9498.    #include "wpfolder.h"
  9499.  
  9500. If the global option is used, the resulting source code would be as follows: 
  9501.  
  9502. #include <wpfolder.h>
  9503.  
  9504. The last part of the class section is for comments.  Using "--" as the comment 
  9505. style causes a comment block to be passed through to the interface definition 
  9506. (.SC) file. 
  9507.  
  9508. Parent Class Section 
  9509.  
  9510. The parent class section specifies the parent of the new class.  All classes 
  9511. must have this section. The parent class section for the password-protected 
  9512. folder example appears as follows: 
  9513.  
  9514. #
  9515. # Parent class
  9516. #
  9517. parent: WPFolder;
  9518.  
  9519. Release Order Section 
  9520.  
  9521. This section allows the programmer to specify the sequence in which the methods 
  9522. and public data will be released.  Since this sequence is maintained by the SOM 
  9523. Precompiler, other programs using this class will not need to be recompiled 
  9524. every time something new is added to the class. 
  9525.  
  9526. The password-protected folder example has only one public method in addition to 
  9527. those already defined by its ancestor classes.  This method is seen in the 
  9528. release section as follows: 
  9529.  
  9530. #
  9531. # Specify the release order of new methods
  9532. #
  9533. release order: LockFolder;
  9534.  
  9535. Since other public methods are defined by the parent class or by its ancestors, 
  9536. the programmer creating an object class need not define these methods in the 
  9537. class definition file.  Hence the programmer need not be aware of the existing 
  9538. methods in the parent class, unless they require modification for use by the 
  9539. new class.  This is in accordance with the object-oriented concept of 
  9540. encapsulation. 
  9541.  
  9542. Metaclass Section 
  9543.  
  9544. For the password-protected folder example (and in most other cases) an explicit 
  9545. metaclass is not required.  The concept of metaclasses is discussed in 
  9546. Metaclasses.  Readers desiring more knowledge of programming using metaclasses 
  9547. should refer to the IBM SOM Programming Reference. 
  9548.  
  9549. Passthru Section 
  9550.  
  9551. This section allows the programmer to define blocks of C source code that are 
  9552. passed through to any of the files generated by the SOM Precompiler.  Each 
  9553. passthru block is distinguished by an identifier, the syntax of which is as 
  9554. follows: 
  9555.  
  9556.    passthru: <language>.<suffix>
  9557.  
  9558. The password-protected folder example has two passthru sections.  The first 
  9559. passthru is "C.h", which passes the code block to the C binding file 
  9560. pwfolder.h.  This block of code defines a DebugBox macro, which can be used 
  9561. anywhere in the code for the new class. 
  9562.  
  9563. #
  9564. # Passthru a debug message box to the .ih file
  9565. # (for inclusion in the .c file)
  9566. #
  9567. passthru: C.h, after;
  9568.  
  9569. #define DebugBox(Title, Text) WinMessageBox(HWND_DESKTOP,
  9570.                                             HWND_DESKTOP,
  9571.                                             (PSZ)Text,
  9572.                                             (PSZ)Title,
  9573.                                             0,
  9574.                                             MB_OK |
  9575.                                             MB_INFORMATION)
  9576.  
  9577. endpassthru;
  9578.  
  9579. The second passthru block is "C.ph"; this passes the code block to the C 
  9580. binding file pwfolder.ph.  This block is used to define a data structure that 
  9581. is accessed by the private methods _GetInfo and _SetInfo, and is used to pass 
  9582. information to and from the dialog procedure that prompts the user for the 
  9583. folder password. 
  9584.  
  9585. #
  9586. # Passthru private definitions to the .ph file
  9587. # (for inclusion in the .c file)
  9588. #
  9589. passthru: C.ph;
  9590.  
  9591. typedef struct _PWF_INFO {
  9592.                          CHAR   szPassword[20&rbk.;
  9593.                          CHAR   szCurrentPassword[20];
  9594.                          CHAR   szUserid[20];
  9595.                          } PWF_INFO;
  9596. typedef PWF_INFO *PPWF_INFO;
  9597.  
  9598. endpassthru;
  9599.  
  9600. Data Section 
  9601.  
  9602. This section lists the instance variables used by the class.  In the 
  9603. password-protected folder example, three variables are defined as follows: 
  9604.  
  9605. #
  9606. # Define instance data for the class
  9607. #
  9608. data:
  9609. CHAR szPassword[20];
  9610. --  This is the password that locks the folder
  9611. CHAR szCurrentPassword[20];
  9612. --  This is the password the user has entered to be
  9613. --  checked against the lock password
  9614. CHAR szUserid[20];
  9615. --  The userid data is here for future expansion
  9616.  
  9617. Note that the szUserid instance variable is not used in the version discussed 
  9618. in this document, since the current example assumes only a single workstation 
  9619. user.  However, it is feasible for user identification to be obtained at 
  9620. startup, and held by the system for authentication against a password to 
  9621. determine whether access is permitted. 
  9622.  
  9623. Methods Section 
  9624.  
  9625. The last section in the class definition file contains a list of all the 
  9626. methods to be defined by the object class.  ANSI C function-prototype syntax is 
  9627. used to define each method.  When coding these definitions, it is recommended 
  9628. that the methods be divided into the following parts: 
  9629.  
  9630.  1. Methods that are new for this class 
  9631.  
  9632.  2. Methods that are overridden from ancestor classes. 
  9633.  
  9634. The following section shows two methods taken from the folder example's class 
  9635. definition file. 
  9636.  
  9637. This first method will be used in the password dialog to take a copy of the 
  9638. object's instance data and place it in a structure that the dialog code may 
  9639. access. 
  9640.  
  9641. #
  9642. # Define new methods
  9643. #
  9644. methods:
  9645.  
  9646. BOOL QueryInfo(PPWF_INFO pPWFolderInfo), private;
  9647. --
  9648. -- METHOD:   QueryInfo                                   PRIVATE
  9649. --
  9650. -- PURPOSE:  Copy the PWFolder instance data into
  9651. --           the PWF_INFO structure that pPWFolderInfo
  9652. --           points to.
  9653. --
  9654.  
  9655. The second example shows an overridden method. This method originates in the 
  9656. WPObject class, which is a base class. It is used to set up the password string 
  9657. when the folder object is created. 
  9658.  
  9659. #
  9660. # Specify methods being overridden
  9661. #
  9662.  
  9663. override wpSetup;
  9664. --
  9665. -- OVERRIDE: wpSetup                                     PUBLIC
  9666. --
  9667. -- PURPOSE:  Here we can set the folder password
  9668. --           to that passed in from the object
  9669. --           create command.
  9670. --
  9671.  
  9672. More detailed information on class definition files and the OIDL is given in 
  9673. the IBM SOM Programming Reference. 
  9674.  
  9675.  
  9676. ΓòÉΓòÉΓòÉ 17.3.3. C Implementation of an Object Class ΓòÉΓòÉΓòÉ
  9677.  
  9678. When the SOM Precompiler has been run successfully against a class definition 
  9679. file, it will produce all the source files necessary to build a Workplace Shell 
  9680. DLL. The most important of these files for the C programmer is the C source 
  9681. code file, which has an extension of .C.  This file contains definitions and 
  9682. "function stubs" for all the methods defined by the class.  This file must be 
  9683. edited by the programmer to add the actual application logic to each method. 
  9684. Figure "A SOM Precompiler-generated Function Stub" shows the SOM 
  9685. Precompiler-generated function stub for the QueryInfo method from the folder 
  9686. example. 
  9687.  
  9688.  
  9689. ΓòÉΓòÉΓòÉ 17.4. Object Behavior ΓòÉΓòÉΓòÉ
  9690.  
  9691. The behavior of an object in the Workplace Shell is very similar to that of a 
  9692. window under Presentation Manager.  An object must have its class registered 
  9693. with the system, an instance of that class must be created ("instantiated") in 
  9694. the system, and that instance (and any other instance) then receives messages 
  9695. and uses its methods to process these messages. When processing is completed, 
  9696. the instance may be destroyed. 
  9697.  
  9698. One significant difference between a Workplace Shell object class and a window 
  9699. class under Presentation Manager is that Workplace Shell object classes are 
  9700. normally persistent; that is, while a Presentation Manager window class is 
  9701. defined only for the duration of the application's execution, a Workplace Shell 
  9702. object class remains defined to the system, and is useable by any application 
  9703. until such time as it is explicitly deregistered from the system. 
  9704.  
  9705.  
  9706. ΓòÉΓòÉΓòÉ 17.4.1. Creating an Object ΓòÉΓòÉΓòÉ
  9707.  
  9708. A new object class in the Workplace Shell is typically created by taking an 
  9709. existing object class and subclassing it, introducing new data and methods, and 
  9710. modifying existing behaviors where required.  The new object class is then 
  9711. registered with the Workplace Shell, and is available from that point on. 
  9712.  
  9713. Registration 
  9714.  
  9715. Once an object class has been defined, compiled and placed into a dynamic link 
  9716. library, it must be registered with Workplace Shell before it can be used. 
  9717. This may be accomplished in either of two ways: 
  9718.  
  9719.  The simplest method is to place the DLL for the object in a directory that is 
  9720.   included in the LIBPATH statement in CONFIG.SYS.  Once this is done, opening 
  9721.   the the Templates folder on the Workplace Shell desktop will automatically 
  9722.   cause the DLL to be loaded and a template for the object class to appear in 
  9723.   the Templates folder. 
  9724.  
  9725.  An object class may also be registered with the Workplace Shell using the 
  9726.   WinRegisterObjectClass() function. This function records the name of the 
  9727.   object class, and the name of the DLL that contains the code to implement the 
  9728.   class. 
  9729.  
  9730. An example of the WinRegisterObjectClass() function is given in Figure 
  9731. "Registering a Workplace Shell Object Class". 
  9732.  
  9733. Figure "Registering a Workplace Shell Object Class" provides a very simple 
  9734. example; a useful technique for registering object classes is to build a simple 
  9735. program that reads a set of strings from an ASCII data file and uses these 
  9736. strings as parameters to the WinRegisterObjectClass() function.  In this way, a 
  9737. generic object-registraion routine can be built and used for multiple object 
  9738. classes, without the need to modify and recompile source code. 
  9739.  
  9740. Note that once an object class has been registered with the Workplace Shell, it 
  9741. is permanently available until it is explicitly deleted by deregistering it. 
  9742. See Deregistering an Object Class for information on deregistering an object 
  9743. class. 
  9744.  
  9745. Class Data 
  9746.  
  9747. Class data is owned by the object class rather than by an instance of that 
  9748. class.  It is therefore available to all instances of the class, and must be 
  9749. initialized prior to instantiating any objects within the class. 
  9750.  
  9751. For this reason, class data is initialized when the object classes are loaded 
  9752. from their DLLs, either during Workplace Shell initialization or dynamically 
  9753. during execution.  Class data initialization is performed by the _wpclsInitData 
  9754. class method, which is called by the system when the class is loaded.  If a new 
  9755. object class has class data that must be initialized, it should override the 
  9756. _wpclsInitData method and perform its class-specific processing. 
  9757.  
  9758. An example of an overridden _wpclsInitData method from the password-protected 
  9759. folder example is shown in Figure "Initializing Class Data". 
  9760.  
  9761. In the example shown in Figure "Initializing Class Data", a global variable 
  9762. hModule is used to contain the module handle for the DLL, which is required 
  9763. when loading Presentation Manager resources such as strings, pointers or 
  9764. dialogs.  Since a global variable is used rather than a class data variable, 
  9765. the first statement in the overridden method, which obtains a handle to the 
  9766. class data, is not required and is therefore commented out. 
  9767.  
  9768. Any class data items obtained or initialized by an object class from within the 
  9769. _wpclsInitData method should also be freed by the object class, by overriding 
  9770. the _wpclsUnInitData method. This method is invoked by the system when an 
  9771. object class is deregistered (see Deregistering an Object Class), or when the 
  9772. Workplace Shell process is terminated.  An example of the _wpclsUnInitData 
  9773. method is shown in Figure "Freeing Class Data Items". 
  9774.  
  9775. The example shown in Figure "Freeing Class Data Items" assumes that the module 
  9776. handle for the DLL has already been obtained and stored in the global variable 
  9777. hModule, as shown in Figure "Initializing Class Data". 
  9778.  
  9779. Instantiation 
  9780.  
  9781. Once an object class has been registered with the Workplace Shell, an instance 
  9782. of that class may be created; this is normally known as instantiation.  This 
  9783. may be done in one of two ways.  The simplest method is to open the Templates 
  9784. folder and drag the template for the object class to the required location. 
  9785. Alternatively, an object may be created from within an application, using the 
  9786. WinCreateObject() function, an example of which is given in Figure "Creating an 
  9787. Object". 
  9788.  
  9789. Note that the pszParams parameter shown in Figure "Creating an Object" is used 
  9790. to contain a setup string, which can be used to pass one or more of a number of 
  9791. parameters to the object class.  In the example, it is used only to set the 
  9792. icon for the object, but may also be used to specify other parameters for that 
  9793. instance of the class.  The keywords and values supported by the WPObject class 
  9794. are documented in the IBM OS/2 Version 2.0 Presentation Manager Reference; 
  9795. other object classes may add their own keywords and values. 
  9796.  
  9797. The final parameter contains one or more flags which determine the behavior of 
  9798. the WinCreateObject() call if the object being created clashes with an object 
  9799. that already exists with the specified name and in the specified location. 
  9800. Valid actions are for the call to fail, to update the existing object or to 
  9801. replace the existing object.  These flags are documented in the IBM OS/2 
  9802. Version 2.0 Presentation Manager Reference. 
  9803.  
  9804. The setup string is passed as a parameter to the _wpSetup method, which is 
  9805. invoked when the object is instantiated.  This method is defined by the 
  9806. WPObject class, and may be overridden by a new object class in order to check 
  9807. for its own keywords and take appropriate setup action. 
  9808.  
  9809. The _wpSetup method accepts the setup string as a parameter, and may then parse 
  9810. the setup string, extract any class-specific data and perform appropriate 
  9811. processing on that data.  However, since many of the keywords that may be 
  9812. specified in the setup string are defined by the WPObject class and are handled 
  9813. by the default _wpSetup method, the default processing must be carried out.  In 
  9814. this particular case, the default processing may be carried out before or after 
  9815. the class-specific processing. 
  9816.  
  9817. An example of an overridden _wpSetup method is shown in Figure "Object Setup"; 
  9818. this example shows the use of an additional parameter in the setup string 
  9819. (PASSWORD=) to set an initial password for a password-protected folder upon 
  9820. folder creation. 
  9821.  
  9822. The setup string is parsed from within the object by calling the 
  9823. _wpScanSetupString method. Both of these methods, along with the keywords 
  9824. supported by the WPObject class, are described in the IBM OS/2 Version 2.0 
  9825. Presentation Manager Reference. 
  9826.  
  9827. After performing the class-specific processing in the _wpSetup method, an 
  9828. object class should invoke its parent class's _wpSetup method to perform the 
  9829. default processing for any other keywords in the setup string that are defined 
  9830. by the parent class. 
  9831.  
  9832. Before the _wpSetup method is invoked, the system invokes the object's 
  9833. _wpInitData method, which allows an object to allocate resources and initialize 
  9834. its instance data.  See Instance Data below for further details. 
  9835.  
  9836. Note that unlike a Presentation Manager window, which exists only for the 
  9837. duration of an application's execution, an object remains in existence 
  9838. permanently unless explicitly deleted from the system. 
  9839.  
  9840. Instance Data 
  9841.  
  9842. When an object is created or awakened from a dormant state, the _wpInitData 
  9843. method is invoked by the system.  This method allows an object to initialize 
  9844. its instance data to a known state.  Operating system resources should be 
  9845. allocated at this stage, but Presentation Manager resources should not, since a 
  9846. view of the object is not yet being opened.  The allocation of Presentation 
  9847. Manager resources is typically done during processing of the _wpOpen method 
  9848. (see Using an Object (Opening an Object)). 
  9849.  
  9850. If an object has its own instance data, which must be initialized to a known 
  9851. state before processing may be carried out, the object should override the 
  9852. _wpInitData method in its class definition file, and include the initialization 
  9853. code.  However, for any object class other than a base storage class, the 
  9854. default initialization processing must be carried out in addition to the 
  9855. class-specific processing.  This allows the correct initialization of any 
  9856. instance data items defined by the parent class, and ensures that the new 
  9857. object class behaves in a manner consistent with its ancestors. 
  9858.  
  9859. Figure "Initializing Instance Data" shows an overridden _wpInitData method, 
  9860. which initializes the password information for a password-protected folder. 
  9861.  
  9862. Note that during processing of the _wpInitData method, the instance data of the 
  9863. object is not necessarily in a known state.  The programmer must therefore take 
  9864. great care when carrying out any processing during the execution of this 
  9865. method, in order to avoid using data that may not yet have been initialized 
  9866. correctly.  Failure to follow this guideline may cause unpredictable results 
  9867. for the object. 
  9868.  
  9869.  
  9870. ΓòÉΓòÉΓòÉ 17.4.2. Using an Object ΓòÉΓòÉΓòÉ
  9871.  
  9872. A user typically accesses an object by opening a view of that object.  For 
  9873. example, to access the contents of a folder object, the user opens the default 
  9874. view (usually an icon view) of the folder, which then displays its contents. 
  9875. This is certainly true for container objects such as folders, and for the 
  9876. password-protected folder class used as an example in this chapter, although 
  9877. other "device" objects such as printers or the shredder may be used without a 
  9878. view. 
  9879.  
  9880. When no view of an object is open, and the folder within which the object 
  9881. resides is not open, the object is said to be dormant;  typically, no system 
  9882. resources are allocated to the object and its instance data is in an unknown 
  9883. state.  Opening and closing views of an object therefore involve not only the 
  9884. opening and closing of windows, but also allocating and freeing resources, and 
  9885. saving and restoring the instance data of the object.  Similarly, opening a 
  9886. folder requires saving and restoring the instance data of the objects in that 
  9887. folder. 
  9888.  
  9889. Opening an Object 
  9890.  
  9891. As mentioned above, a user typically interacts with an object using a view of 
  9892. that object.  An object may support various types of view; for example, the 
  9893. WPFolder object class supports icon, tree, details and settings views. By 
  9894. default, an object class supports the view types defined by its ancestors, and 
  9895. a programmer may also define new view types for the object class. 
  9896.  
  9897. When a view of an object is opened, a method named _wpOpen is invoked by the 
  9898. Workplace Shell.  This method is defined and implemented by the base storage 
  9899. class WPObject, and may be overridden by a new object class to perform its own 
  9900. class-specific processing.  The supported views for each object class are 
  9901. implemented as part of the _wpOpen method, using Presentation Manager windows. 
  9902.  
  9903. When a view is opened by the user from a context menu, the _wpMenuItemSelected 
  9904. method is invoked (see Methods (Attaching a Method to the Context Menu) for 
  9905. more detailed discussion of this method).  The _wpMenuItemSelected method 
  9906. typically invokes the _wpOpen method, and passes the identifier of the 
  9907. requested view as the third parameter.  The _wpOpen method may then interrogate 
  9908. this parameter to decide which view to open. 
  9909.  
  9910. When the user opens a view by double-clicking the mouse on an object's icon, 
  9911. the system invokes the _wpOpen method and passes an OPEN_DEFAULT value.  The 
  9912. default processing for the _wpOpen method invokes the _wpQueryDefaultView 
  9913. method to determine the default view for the object, and immediately invokes 
  9914. the _wpOpen method a second time with the identifier for that view. 
  9915.  
  9916. An example of an overridden _wpOpen method is given in Figure "Opening an 
  9917. Object".  This example shows a password-protection facility being added to a 
  9918. folder to prevent access by unauthorized users.  Upon invocation of the _wpOpen 
  9919. method, the password-protected folder object class displays a dialog box to 
  9920. accept a password from the user.  It then compares that password with the 
  9921. correct password for that folder before actually opening the folder.  Visual 
  9922. cues such as the folder's icon and the word "Locked" on the folder's title are 
  9923. modified or removed during the _wpOpen processing. 
  9924.  
  9925. Since the view being opened in this case is the icon view defined by the 
  9926. WPFolder class, the actual opening of the view and presentation of the folder's 
  9927. contents is handled using the default processing supplied by the parent class, 
  9928. which is called after the class-specific processing has completed. 
  9929.  
  9930. If an object class wishes to create a new view, it must add the name of the 
  9931. view to the Open submenu in the object's context menu, and include a case for 
  9932. that view in the _wpMenuItemSelected method. This method then invokes _wpOpen 
  9933. with a specific value in the ulView parameter, indicating the view to be 
  9934. opened.  The class-specific processing for _wpOpen must test for this value, 
  9935. open a window and display the correct information using Presentation Manager 
  9936. functions. 
  9937.  
  9938. The example in Figure "Opening an Object" does not include the code to set the 
  9939. folder's icon to the "unlocked" state.  This code is identical to the code used 
  9940. in Figure "Adding a New Method" to set the icon to the "locked" state; the 
  9941. resource identifier of the "unlocked" icon is simply substituted in the _wpOpen 
  9942. method for the identifier of the "locked" icon. 
  9943.  
  9944. Note that in many cases, it is important for an object class to allow the 
  9945. default processing for _wpOpen to occur before it attempts to carry out its own 
  9946. processing.  This allows instance data and control information to be 
  9947. established and initialized before the object attempts any processing using 
  9948. these items.  In Figure "Opening an Object" however, the additional 
  9949. class-specific processing determines whether the object should open at all; if 
  9950. processing is allowed to proceed, no alteration to the default processing takes 
  9951. place.  The default processing may therefore be carried out after the 
  9952. additional class-specific processing introduced by the password-protected 
  9953. folder class. 
  9954.  
  9955. The default processing for the _wpOpen method supports a number of views, 
  9956. depending upon the parent class of the object; for example, the processing for 
  9957. the WPFolder class supports ICON, TREE and DETAILS views.  For new object 
  9958. classes which support additional views, the _wpOpen method must be overridden 
  9959. and the additional view types opened explicitly as windows using appropriate 
  9960. Presentation Manager functions.  Since a view of an object is essentially a 
  9961. window, new views can be implemented as normal Presentation Manager windows and 
  9962. the correct information displayed using text or graphical programming 
  9963. functions, according to the requirements of the object class. 
  9964.  
  9965. Note that upon opening a view using a Presentation Manager window, an object 
  9966. should add itself to the "Use List" maintained by the Workplace Shell.  If the 
  9967. view is the first view of the object to be opened, this causes the Workplace 
  9968. Shell to modify the object's icon to indicate the "in use" state.  The object 
  9969. should also register the view with the Workplace Shell, which will then 
  9970. subclass the view's frame window, automatically attach the object's context 
  9971. menu to the window's system menu icon, and add the view to the Workplace 
  9972. Shell's Window List.  These steps are done using the _wpAddToObjUseList and 
  9973. _wpRegisterView methods, as shown in Figure "Opening a Custom View of an 
  9974. Object". 
  9975.  
  9976. The Workplace Shell makes use of a USEITEM and a VIEWITEM structure in the 
  9977. _wpAddToObjUseList method.  It assumes that these structures are contiguous in 
  9978. memory; hence they should be allocated as part of a larger data structure such 
  9979. as the OBJECTVIEW structure shown in Figure "Opening a Custom View of an 
  9980. Object".  A pointer to this structure is stored in the window words of the view 
  9981. window, so that information such as the object's pointer can be accessed from 
  9982. the view's window procedure. 
  9983.  
  9984. Note that upon closing a view, the view's window procedure should invoke the 
  9985. _wpDeleteFromObjUseList method to remove the view from the Use List.  If the 
  9986. view is the only open view of the object, the object's icon is modified to 
  9987. remove the "in use" emphasis. 
  9988.  
  9989. Automatic Opening Upon Instantiation 
  9990.  
  9991. In many cases, it is desirable to automatically open a view of an object when 
  9992. the object is created.  This may be achieved by using the OPEN= keyword in the 
  9993. setup string passed to the WinCreateObject() function.  An example of this 
  9994. technique is shown in Figure "Automatically Instantiating an Object". 
  9995.  
  9996. The opening of the view specified in the OPEN= keyword is handled by the 
  9997. default processing for the _wpSetup method, as defined by the WPObject class. 
  9998. The default processing supports the icon, tree and details views, specified 
  9999. using the ICON, TREE and DETAILS values for the OPEN= keyword respectively. 
  10000. For new object classes that support additional views, the _wpSetup method must 
  10001. be overridden and the additional view types opened explicitly as windows using 
  10002. appropriate Presentation Manager functions. 
  10003.  
  10004. Closing an Object 
  10005.  
  10006. When all open views of an object are to be closed, the _wpClose method is 
  10007. invoked.  This method is normally invoked when the user selects the Close 
  10008. option from a view's context menu. 
  10009.  
  10010. The _wpClose method may be overridden to perform class-specific processing for 
  10011. closing views, or to free system resources allocated during processing of the 
  10012. _wpOpen method.  For example, Figure "Closing an Object" shows the _wpClose 
  10013. method being overridden to automatically lock a password-protected folder 
  10014. whenever it is closed by the user. 
  10015.  
  10016. When a view of an object is closed, the system sends a WM_DESTROY message to 
  10017. the view's frame window.  This allows the object to release any allocated 
  10018. resources and save its instance data, so that the object may be reopened in its 
  10019. current state at some future time. 
  10020.  
  10021. Note that since the _wpClose method is defined by the parent class and is 
  10022. overridden, the default processing performed by the parent is called after the 
  10023. class-specific processing has completed. 
  10024.  
  10025. Saving and Restoring the Object State 
  10026.  
  10027. As already mentioned, an object is persistent; that is, it remains in existence 
  10028. even when all views of the object are closed.  In order to maintain its 
  10029. instance data so that it may subsequently be opened in the same state in which 
  10030. it was closed, the object must save this data when its views are closed and 
  10031. restore it when a view is opened.  The Workplace Shell provides methods that 
  10032. handle the saving and restoration of instance data on behalf of object classes; 
  10033. these methods are automatically invoked by the system at the appropriate times, 
  10034. and are described below. 
  10035.  
  10036. When an object is made dormant, the system invokes the object's _wpSaveState 
  10037. method, which allows the object to save its instance data.  A number of 
  10038. predefined methods are available to the object to save its data, such as 
  10039. _wpSaveString. These methods may be called by the object during the processing 
  10040. of its _wpSaveState method, in order to save instance data.  An example of the 
  10041. _wpSaveState method for the password-protected folder example is given in 
  10042. Figure "Saving an Object's State". 
  10043.  
  10044. An object's instance data items are saved in different locations, depending 
  10045. upon the class of the object.  Object classes that are descendants of the 
  10046. WPAbstract class store their instance data in the OS/2 initialization file 
  10047. OS2.INI.  Object classes that are descendants of the WPFileSystem class store 
  10048. their instance data in extended attributes.  Since the password-protected 
  10049. folder class is descended from the WPFolder class defined by the Workplace 
  10050. Shell, which in turn is a descendant of the WPFileSystem class, the instance 
  10051. data of this object class is saved as extended attributes in the OS/2 file 
  10052. system. 
  10053.  
  10054. The class-defined key passed to the _wpSaveString method is used to save the 
  10055. data item in a particular location, which can then be accessed, using the same 
  10056. key, to restore the item.  In addition to strings, numeric data may be saved 
  10057. using the _wpSaveLong method, and other binary data such as application-defined 
  10058. data structures may be saved using the _wpSaveData method. 
  10059.  
  10060. Note that since the _wpSaveState method is defined by the object's class's 
  10061. ancestors and overridden, it must invoke the default processing supplied by the 
  10062. parent class in order to correctly save any instance data defined by ancestor 
  10063. classes.  Failure to do so may cause unpredictable results upon awakening the 
  10064. object from its dormant state. 
  10065.  
  10066. An object must retrieve its instance data and restore its state whenever it is 
  10067. made awake.  At this point, the system invokes an object's _wpRestoreState 
  10068. method, which allows the object to restore its state.  During the processing of 
  10069. this method, the object can invoke other methods such as _wpRestoreString, 
  10070. which restore specific instance data items.  An example of the _wpRestoreState 
  10071. method is given in Figure "Restoring an Object's State". 
  10072.  
  10073. The class-defined key passed to the _wpRestoreString method is used to locate 
  10074. the required data item, and the item is restored into the specified target 
  10075. string variable.  Numeric data can be restored using the _wpRestoreLong method, 
  10076. and other binary data such as application-defined structures can be restored 
  10077. using the _wpRestoreData method. 
  10078.  
  10079. Since the _wpRestoreState method is an overridden method, it is important that 
  10080. the default processing supplied by the parent class be invoked. Failure to do 
  10081. so will result in any instance data defined by ancestor classes being in an 
  10082. unknown state, with unpredictable results. 
  10083.  
  10084.  
  10085. ΓòÉΓòÉΓòÉ 17.4.3. Destroying an Object ΓòÉΓòÉΓòÉ
  10086.  
  10087. A specific instance of an object class can be destroyed by the user, simply by 
  10088. dragging it over the Shredder object on the Workplace Shell desktop.  If an 
  10089. object or application wishes to delete an object, it may do so using the 
  10090. WinDestroyObject() function, as shown in Figure "Destroying an Object". 
  10091.  
  10092. The WinDestroyObject() function uses the object handle that is returned by the 
  10093. WinCreateObject() function.  The object or application that creates the object 
  10094. is responsible for storing this handle during the existence of the object. 
  10095.  
  10096. When an object is destroyed, the system invokes the object's _wpUnInitData 
  10097. method, which may be used to free any resources or instance data items that 
  10098. were allocated to that particular object. 
  10099.  
  10100.  
  10101. ΓòÉΓòÉΓòÉ 17.4.4. Deregistering an Object Class ΓòÉΓòÉΓòÉ
  10102.  
  10103. An entire object class can be deleted from the system by deregistering it from 
  10104. the Workplace Shell  This is achieved using the WinDeregisterObjectClass() 
  10105. function, which is shown in Figure "Deregistering an Object Class". 
  10106.  
  10107. The WinDeregisterObjectClass() function accepts a string containing the object 
  10108. class name.  Once a successful call is made to the WinDeregisterObjectClass() 
  10109. function, the object class is deleted from the system and is no longer 
  10110. available to other objects or applications. However, the DLL that contains the 
  10111. code for the object class is not automatically deleted from the system; if the 
  10112. Templates folder is subsequently opened with this DLL still resident in a 
  10113. directory in the system's LIBPATH, a template for the class will still appear 
  10114. in the folder. In order to prevent this, the DLL must be explicitly deleted 
  10115. from the system. 
  10116.  
  10117. During processing of the WinDeregisterObjectClass() call, the system invokes 
  10118. the object's _wpclsUnInitData method, to free any instance data or resources 
  10119. that were obtained when the object class was created.  See Creating an Object 
  10120. (Class Data) for an example of this method. 
  10121.  
  10122.  
  10123. ΓòÉΓòÉΓòÉ 17.4.5. Accessing Presentation Manager Resources From a Workplace Shell Object ΓòÉΓòÉΓòÉ
  10124.  
  10125. A Workplace Shell object may access and make use of Presentation Manager 
  10126. resources such as icons, bitmaps, strings and dialogs. These resources may 
  10127. reside in the same DLL as the object's code, or in another DLL.  However, since 
  10128. the resources must reside in a DLL, the code that loads the resources must use 
  10129. the DosLoadModule or DosGetModuleHandle() functions to obtain module handles, 
  10130. as described in Loading Resources From a DLL.  This is typically done by 
  10131. obtaining the module handles as part of the _wpclsInitData method, and storing 
  10132. them either in global variables or in class data until needed. 
  10133.  
  10134.  
  10135. ΓòÉΓòÉΓòÉ 17.5. Transient Objects ΓòÉΓòÉΓòÉ
  10136.  
  10137. As mentioned earlier in this chapter, a Workplace Shell object differs from a 
  10138. Presentation Manager window in that it is persistent; that is, it continues to 
  10139. exist after a system restart.  The exception to this rule is the transient 
  10140. object, which only exists during the current execution of the system, and is 
  10141. destroyed when the system is IPLed. 
  10142.  
  10143. Transient objects are useful when a programmer wishes to represent and display 
  10144. information such as records from a database.  As each record is retrieved, a 
  10145. transient object is created for that record and displayed in a folder on the 
  10146. Workplace Shell desktop.  These objects may be opened and manipulated by the 
  10147. end user, but will cease to exist when the system is IPLed. 
  10148.  
  10149. Figure "Creating a Transient Object" shows an object window in a requester 
  10150. process which, upon receiving a completed database query from a server process, 
  10151. invokes the _wpclsNew method to create a new instance of a transient object 
  10152. class, representing the record retrieved from the database. 
  10153.  
  10154. The SOM pointer to the transient object class is obtained using the 
  10155. SOMIdFromString() macro and the _somFindClass method (see Communication Between 
  10156. Objects for further information).  This pointer is then used to invoke the 
  10157. _wpclsNew method to create a new instance of the class.  Once the new instance 
  10158. is created, a method named _SetCustInfo, which is defined by the transient 
  10159. object class, is invoked to insert the information retrieved from the database 
  10160. into the object's instance data. 
  10161.  
  10162. Note that the technique shown in Figure "Creating a Transient Object" may only 
  10163. be used when an object is created from within the Workplace Shell process.  If 
  10164. an object must be created from another process in the system, the 
  10165. WinCreateObject() function must be used. 
  10166.  
  10167.  
  10168. ΓòÉΓòÉΓòÉ 17.6. Building a Workplace Shell Application ΓòÉΓòÉΓòÉ
  10169.  
  10170. As already mentioned, an application that exploits the Workplace Shell consists 
  10171. of a number of objects on the desktop or in folders, which interact with one 
  10172. another to carry out operations as requested by the user.  The implementation 
  10173. of the Workplace Shell under OS/2 V2.0 causes all Workplace Shell objects to 
  10174. run in a single process, under the control of the Workplace Shell itself.  It 
  10175. is therefore possible for an error in a Workplace Shell to terminate the 
  10176. Workplace Shell process, and all objects currently open under the control of 
  10177. that process.  While the Workplace Shell automatically restarts itself and its 
  10178. open objects, it is recommended for reasons of performance that applications 
  10179. carrying out lengthy processing such as database or remote system access should 
  10180. be implemented using multiple processes.  Other processes in the system are not 
  10181. affected if the Workplace Shell process terminates, and become available to the 
  10182. user as soon as the shell restarts itself, without the need to reload 
  10183. application code, reinitialize communications links, etc. 
  10184.  
  10185. For example, a database query application that searches a database for customer 
  10186. records and displays these in a Workplace Shell folder may be composed of two 
  10187. processes, each with multiple threads, as shown in Figure "Workplace Shell 
  10188. Application Structure." 
  10189.  
  10190. The requester portion of the application, which allows the user to enter a 
  10191. query, and which displays the results on the screen, is implemented as a 
  10192. Workplace Shell object, running under the control of the Workplace Shell 
  10193. process.  The primary thread in this process carries out the interaction with 
  10194. the end user, while a secondary thread is created to handle communication 
  10195. between processes. 
  10196.  
  10197. The second process acts as a database server, and is created by the first 
  10198. process when the application is started.  The server process has a primary 
  10199. thread that accepts requests from the requester in the Workplace Shell process, 
  10200. and a number of secondary threads that actually perform the database access. 
  10201.  
  10202. If an errant object or application were to cause the Workplace Shell to 
  10203. terminate, the requester threads would be terminated.  However, the server 
  10204. process would not be terminated, and communication with the requester could be 
  10205. re-established simply by having the requester initiate one of the standard 
  10206. interprocess communication mechanisms described in Multitasking Considerations. 
  10207.  
  10208.  
  10209. ΓòÉΓòÉΓòÉ 17.7. Communication Between Objects ΓòÉΓòÉΓòÉ
  10210.  
  10211. Objects communicate with one another in order to convey events and initiate 
  10212. actions on the part of other objects.  Such communication is typically 
  10213. initiated in one of two ways: 
  10214.  
  10215.  By an object to convey information to another object with which it has an 
  10216.   application-defined relationship, such as a request.  This is similar to the 
  10217.   application-initiated event discussed for Presentation Manager applications 
  10218.   in The Presentation Manager Application Model. 
  10219.  
  10220.  By the user directly manipulating the objects' icons.  For example, dropping 
  10221.   one icon over another icon initiates a conversation between the two objects. 
  10222.   This is similar to the user-initiated event discussed for Presentation 
  10223.   Manager applications in The Presentation Manager Application Model. 
  10224.  
  10225. Each of these types of communication is discussed in the following sections. 
  10226.  
  10227.  
  10228. ΓòÉΓòÉΓòÉ 17.7.1. Application-Initiated Communication ΓòÉΓòÉΓòÉ
  10229.  
  10230. In the former case, the communication is quite simple since the initiator of 
  10231. the communication typically has knowledge of the type of object to which the 
  10232. communication is being passed, and can usually initiate the communication by 
  10233. simply invoking a method in the receiving object, in a similar manner to that 
  10234. discussed in Methods (Invoking Another Object's Methods). 
  10235.  
  10236. However, it is often necessary to determine the identity of the object for 
  10237. which a method must be invoked.  The Workplace Shell provides access to objects 
  10238. using the HOBJECT and the OBJECTID and, at a base level, system object model 
  10239. provides pointers to objects and SOM IDs.  Each of these is described in the 
  10240. following sections, and some discussion is included on converting between 
  10241. identifiers. 
  10242.  
  10243. HOBJECT 
  10244.  
  10245. This identifier is the object handle, which is allocated by the Workplace Shell 
  10246. and passed as the return value from the WinCreateObject() function.  It is a 
  10247. persistent object handle that remains allocated to an object for the duration 
  10248. of its existence.  Object handles persist across system restarts, and may 
  10249. therefore be used by one object to refer to another object at any time. 
  10250.  
  10251. An object handle can be determined from the object's OBJECTID using the 
  10252. WinQueryObject() function, as follows: 
  10253.  
  10254. HOBJECT  hObject;                            /* Object handle         */
  10255. PSZ      szObjectID = "<OBJECTID>";          /* OBJECTID string       */
  10256.  
  10257. hObject = WinQueryObject(szObjectID);        /* Query object handle   */
  10258.  
  10259. Note that this function may be called from any process; its use is not 
  10260. restricted to objects in the Workplace Shell process. 
  10261.  
  10262. OBJECTID 
  10263.  
  10264. The OBJECTID is provided by an application or object class as part of the setup 
  10265. string parameter in the WinCreateObject() call, when an object is created.  It 
  10266. is persistent in the same way as an object handle, but provides a more 
  10267. meaningful reference for an object, which can be used by other objects. 
  10268.  
  10269. Figure "Referencing an Object Using OBJECTID" 
  10270.  
  10271. Note that the angle brackets ("<" and ">") used within the OBJECTID are an 
  10272. important part of the syntax. 
  10273.  
  10274. Note also that the Workplace Shell provides a number of predefined OBJECTIDs 
  10275. for system-defined objects.  The first and third WinCreateObject() calls in 
  10276. Figure "Referencing an Object Using OBJECTID" use the <WP_DESKTOP> OBJECTID to 
  10277. place the objects on the desktop. 
  10278.  
  10279. SOM Pointer 
  10280.  
  10281. SOM pointers come in various forms, but can all be typecast to SOMAny *.  From 
  10282. a Workplace Shell perspective, a SOM pointer is the return value of the 
  10283. _wpclsNew class method; this is the method used for creating objects within the 
  10284. Workplace Shell process.  An object's public methods and data can be accessed 
  10285. using the object's SOM pointer. 
  10286.  
  10287. A SOM pointer for an object may be obtained from an object handle using the 
  10288. _wpclsQueryObject method provided by the WPObject class, as follows: 
  10289.  
  10290. SOMAny *Asomptr;                             /* SOM pointers          */
  10291. SOMAny *Bsomptr;
  10292.  
  10293. Asomptr = _wpclsQueryObject(_WPObject,       /* Query SOM pointer     */
  10294.                             hObject);        /* Object handle         */
  10295.  
  10296. A SOM pointer for a class may be obtained from the SOM ID for that class, using 
  10297. the _somFindClass method shown below: 
  10298.  
  10299. Asomptr = _somFindClass(SOMClassMgrObject,
  10300.                         AsomId,
  10301.                         1,
  10302.                         1);
  10303.  
  10304. A SOM pointer for a class may be obtained from the SOM pointer for any object 
  10305. within that class, using the _somGetClass method as follows: 
  10306.  
  10307. Asomptr = _somGetClass(Bsomptr);
  10308.  
  10309. The SOM pointer is typically used to invoke class methods from an object in 
  10310. another class.  The _SOMDispatchL() method shown in Figure "Invoking a Method 
  10311. in Another Object Class" requires a SOM pointer as a parameter. 
  10312.  
  10313. SOM ID 
  10314.  
  10315. A SOM ID is simply a way of mapping a unique number to a string.  This string 
  10316. may represent the name of a method or class.  SOM IDs are integers that are 
  10317. managed by the Workplace Shell using the Atom Manager facility of Presentation 
  10318. Manager.  A SOM ID is obtained using the SOM_IdFromString() function as 
  10319. follows: 
  10320.  
  10321. somId    AsomId;
  10322.  
  10323. AsomId = SOM_IdFromString("WPFolder");
  10324.  
  10325. The SOM ID is typically used to obtain a SOM pointer, which can then be used to 
  10326. invoke a method. 
  10327.  
  10328.  
  10329. ΓòÉΓòÉΓòÉ 17.7.2. User-Initiated Communication ΓòÉΓòÉΓòÉ
  10330.  
  10331. The latter case is somewhat more complex, since the two objects may have no 
  10332. defined relationship.  A conversation must be initiated between the two, 
  10333. whereby each determines the nature of the other, and whether a drop operation 
  10334. is valid at the present time.  If so, each object passes the information 
  10335. required to carry out the requested action. 
  10336.  
  10337. Dragging an Object 
  10338.  
  10339. When the user begins to drag an object, the object being dragged is notified by 
  10340. the system, which invokes the object's _wpFormatDragItem method. This method is 
  10341. used to build a DRAGITEM structure, which is passed to another object if the 
  10342. current object is dragged over it or dropped upon it. The DRAGITEM structure 
  10343. contains rendering information about the object, which is used by other objects 
  10344. over which the object is dragged, in order to determine whether a drop 
  10345. operation is valid at that point. 
  10346.  
  10347. Default information for the DRAGITEM structure is inserted by the default 
  10348. processing provided by the parent class, but an object class may override the 
  10349. method and include its own class-specific processing.  The DRAGITEM structure 
  10350. is nested within a DRAGINFO structure, which is passed to any object over which 
  10351. the current object is dragged.  In a situation where more than one object is 
  10352. being dragged simultaneously, a separate DRAGITEM structure is produced for 
  10353. each object, and the entire set of structures is combined using a single 
  10354. DRAGINFO structure. 
  10355.  
  10356. When an object is dragged over another object, the system invokes the 
  10357. _wpDragOver method in the object being dragged over.  This method receives a 
  10358. DRAGINFO structure, which contains a variety of information including pointers 
  10359. to one or more DRAGITEM structures.  The object may examine these structures 
  10360. and determine whether any of the objects being dragged can be dropped over it. 
  10361. If not, the object changes the mouse pointer to indicate that a drop operation 
  10362. is not valid. 
  10363.  
  10364. Dropping an Object 
  10365.  
  10366. When a drop operation occurs, the object being dropped upon is notified by the 
  10367. system, which invokes the _wpDrop method. This method accepts the DRAGINFO 
  10368. structure, which may be examined by the object to determine the correct action 
  10369. to be taken.  The rendering information contained in the DRAGITEM structure may 
  10370. be sufficient to allow the action to be completed, or the object being dropped 
  10371. upon may initiate a conversation with the object being dragged over it, in 
  10372. order to gain sufficient information to complete the action. 
  10373.  
  10374. The rendering information provided in the DRAGITEM structure, and its use by a 
  10375. Presentation Manager or Workplace Shell object, is described in detail in 
  10376. Direct Manipulation. 
  10377.  
  10378.  
  10379. ΓòÉΓòÉΓòÉ 17.8. Summary ΓòÉΓòÉΓòÉ
  10380.  
  10381. The OS/2 Version 2.0 Workplace Shell provides an object-oriented user interface 
  10382. to the operating system, and provides an object-oriented application layer on 
  10383. top of Presentation Manager, through its implementation of the system object 
  10384. model.  An application that exploits the facilities of the Workplace Shell 
  10385. consists of a number of objects, which are manipulated on the Workplace Shell 
  10386. desktop by the user, in order to carry out the required tasks. 
  10387.  
  10388. Workplace Shell objects conform to "standard" object-oriented principles in 
  10389. that they are grouped into object classes, have instance data, and contain 
  10390. methods which perform the required tasks and operate upon the instance data. 
  10391. Workplace Shell object classes may inherit data and methods from their parent 
  10392. class, in accordance with the object-oriented concept of inheritance.  A class 
  10393. may add additional data items or new methods to perform actions not handled by 
  10394. its parent class, or may override existing methods to handle actions in a 
  10395. different manner. 
  10396.  
  10397. An object class is defined using a class definition file, which defines the 
  10398. parent hierarchy for the object, its data items and its methods.  The class 
  10399. definition file is used as input to the SOM Precompiler, which uses the file to 
  10400. produce a number of source code files and header files.  The source code is 
  10401. edited by the programmer to add the application logic for each method.  It is 
  10402. then compiled using a normal C compiler, and link edited to produce a dynamic 
  10403. link library that implements the object class.  An object class may make use of 
  10404. operating system and Presentation Manager resources during its execution. 
  10405.  
  10406. Workplace Shell objects behave in a similar manner to windows under 
  10407. Presentation Manager; object classes are registered to the Workplace Shell, and 
  10408. individual instances of an object class are created, opened, closed and 
  10409. destroyed by the user or by other objects in the system.  The major difference 
  10410. between a window under Presentation Manager and an object under the Workplace 
  10411. Shell is that Workplace Shell objects are persistent; that is, they exist for 
  10412. longer than a single application execution.  Once created, a Workplace Shell 
  10413. object remains in existence until it is explicitly destroyed. 
  10414.  
  10415.  
  10416. ΓòÉΓòÉΓòÉ 18. Direct Manipulation ΓòÉΓòÉΓòÉ
  10417.  
  10418. Direct manipulation of icons on the Presentation Manager desktop in order to 
  10419. carry out processing tasks has been possible since the first release of 
  10420. Presentation Manager in OS/2 Version 1.1, but only in Version 1.3 was a 
  10421. standard method introduced for implementing such function.  Previously, each 
  10422. programmer needed to devise a set of protocols, and write code in every 
  10423. application to handle all the mouse messages and interaction between windows 
  10424. that may have been needed. 
  10425.  
  10426. OS/2 Version 1.3 introduced some standards for coding direct manipulation 
  10427. operations, in the form of new message classes (the DM_xxxx messages), and 
  10428. standard protocols known as rendering mechanisms, which are used to communicate 
  10429. required information for commonly used direct manipulation operations. This 
  10430. support is continued in OS/2 V2.0, and is of increased importance since the 
  10431. Workplace Shell itself makes extensive use of direct manipulation. 
  10432. Applications that use direct manipulation are therefore more likely to be 
  10433. written under Version 2.0, either to interact with one another or to make use 
  10434. of Workplace Shell facilities such as printer objects or the shredder. 
  10435.  
  10436. This chapter discusses the use of direct manipulation in a program, covering 
  10437. the major messages and data structures involved, and the use of the standard 
  10438. rendering mechanisms.  Examples of the use of these messages and data 
  10439. structures are given, along with guidance on implementing a private rendering 
  10440. mechanism to meet the needs of a particular application. 
  10441.  
  10442.  
  10443. ΓòÉΓòÉΓòÉ 18.1. Direct Manipulation Basics ΓòÉΓòÉΓòÉ
  10444.  
  10445. It might appear that dragging an icon from one window and dropping it onto 
  10446. another is straightforward, but on closer consideration it proves to be 
  10447. somewhat more complex. Consider the simple action of dragging an icon 
  10448. representing a customer from one container window to another, the intention 
  10449. being to move the customer from one branch of the business (represented by the 
  10450. first container) to another (the second container window). The following steps 
  10451. are required: 
  10452.  
  10453.  1. The program owning the first container (hereafter called the source 
  10454.     program) must determine which customer the user wishes to move (hereafter 
  10455.     known as the dragitem). 
  10456.  
  10457.  2. The source program must decide on an icon or bitmap to represent the 
  10458.     customer as the user drags the customer around the screen. 
  10459.  
  10460.  3. The source program must package a number of items of information to travel 
  10461.     with the icon, so that potential target windows may decide whether or not 
  10462.     they will allow the item to be dropped on them. 
  10463.  
  10464.  4. As the icon passes outside the container to other areas, its appearance 
  10465.     must be constantly updated to indicate to the user whether a drop is 
  10466.     allowed. 
  10467.  
  10468.  5. When the icon reaches a potential target window, the program owning the 
  10469.     target window (hereafter known as the target) must access the information 
  10470.     about the dragged item to decide whether it will allow the item to be 
  10471.     dropped.  At this point, the rendering mechanism used to convey this 
  10472.     information becomes significant, since both the source and target must be 
  10473.     able to understand the mechanism. 
  10474.  
  10475.  6. Once a drop has occurred, the target window must decide the form in which 
  10476.     it wishes to receive the dropped object (if more than one form is supported 
  10477.     by both source and target), and inform the source program accordingly. 
  10478.  
  10479.  7. The source program must make the data representing the customer available 
  10480.     to the target program.  Since the source and target programs may not 
  10481.     necessarily run in the same process, this may not be trivial. Again, the 
  10482.     rendering mechanism to be used becomes significant. 
  10483.  
  10484.  8. The source must inform the target that the data is ready. 
  10485.  
  10486.  9. The target must access and retrieve the data. 
  10487.  
  10488. 10. The source must delete its own copy (since the operation is a "move" 
  10489.     operation). 
  10490.  
  10491. 11. The target must display the new customer object in its own container 
  10492.     window, in the location at which it was dropped. 
  10493.  
  10494. While this appears extremely complex, much of the necessary work is done by 
  10495. Presentation Manager for a Presentation Manager application; for a Workplace 
  10496. Shell object, even more of the necessary function is automated by the Workplace 
  10497. Shell.  The remainder of this chapter will describe the steps necessary for a 
  10498. Presentation Manager application and/or a Workplace Shell object to exploit 
  10499. drag/drop functionality. 
  10500.  
  10501.  
  10502. ΓòÉΓòÉΓòÉ 18.1.1. Significant Events ΓòÉΓòÉΓòÉ
  10503.  
  10504. There are a number of significant events that occur during a direct 
  10505. manipulation operation, and which must be communicated to the source and/or 
  10506. target of the operation.  These are as follows: 
  10507.  
  10508.  Initiation of the drag operation, which must be communicated to the source so 
  10509.   that it can initialize data structures with information relating to the 
  10510.   dragitem. 
  10511.  
  10512.  Dragging the object over a potential target, which must be communicated to 
  10513.   the target so that the target can determine whether a drop operation is 
  10514.   valid. 
  10515.  
  10516.  Dropping the object over a target, which must be communicated to the target 
  10517.   so that it may decide the form in which it wishes the dragitem data to be 
  10518.   passed, and allocate any necessary resources to receive the data. 
  10519.  
  10520.  Transferring the information between the source and the target to complete 
  10521.   the overall direct manipulation sequence. 
  10522.  
  10523. Presentation Manager carries out much of the required notification of drag/drop 
  10524. events using messages, which are passed to the source or target windows as 
  10525. necessary during the drag/drop operation.  The required messages are described 
  10526. in the OS/2 2.0 Programming Guide Volume II and their use is discussed in Using 
  10527. Direct Manipulation. 
  10528.  
  10529. In certain cases, the behavior of a Workplace Shell object participating in a 
  10530. direct manipulation operation varies somewhat from that of a Presentation 
  10531. Manager window.  This is due to the fact that the Workplace Shell implements 
  10532. much of the required message handling itself, and directly invokes the 
  10533. appropriate methods in the object.  Where the behavior of a Workplace Shell 
  10534. object differs from that of a Presentation Manager window, this is noted in the 
  10535. text. 
  10536.  
  10537.  
  10538. ΓòÉΓòÉΓòÉ 18.1.2. Rendering Mechanisms ΓòÉΓòÉΓòÉ
  10539.  
  10540. Rendering mechanisms are the means by which the source and target of a 
  10541. drag/drop operation determine the data type of the dragitem and the format of 
  10542. the information to be exchanged. 
  10543.  
  10544. While the precise sequence of events that takes place after a drop has occurred 
  10545. is dependent upon the application, a number of standard rendering mechanisms 
  10546. have been defined to enable diverse applications to engage in direct 
  10547. manipulation with one another.  These standard rendering mechanisms are used by 
  10548. various components of OS/2, as well as being available for use by applications. 
  10549.  
  10550. Three standard rendering mechanisms are provided by Presentation Manager and 
  10551. are documented in the OS/2 2.0 Programming Guide Volume II: 
  10552.  
  10553. DRM_PRINT           This rendering mechanism is designed for applications that 
  10554.                     wish to provide printing facilities via direct 
  10555.                     manipulation, by allowing the user to drag items from the 
  10556.                     application and drop them on one of the Workplace Shell 
  10557.                     printer objects. 
  10558.  
  10559.                     It is a very simple mechanism.  When an object is dropped 
  10560.                     on a printer object, the printer object sends a 
  10561.                     DM_PRINTOBJECT message, one parameter of which gives the 
  10562.                     name of the print queue represented by that printer object. 
  10563.                     It is then the responsibility of the source window to print 
  10564.                     the relevant data to the specified queue. 
  10565.  
  10566.                     Note that in OS/2 Version 1.3, the DM_PRINT message was 
  10567.                     used for this purpose, rather than the DM_PRINTOBJECT 
  10568.                     message. 
  10569.  
  10570. DRM_OS2FILE         This rendering mechanism is intended for applications that 
  10571.                     wish to allow the dragging and dropping of file objects 
  10572.                     between windows or folders on the desktop.  Such 
  10573.                     applications include the File Manager in OS/2 Version 1.3, 
  10574.                     or the Drives objects in OS/2 V2.0. 
  10575.  
  10576.                     With this mechanism, all information about the source file 
  10577.                     may be contained in the fields of the DRAGITEM structure, 
  10578.                     so it is not necessary for a protracted conversation to 
  10579.                     take place between source and target windows.  In the 
  10580.                     simplest case, the target can complete the operation using 
  10581.                     only this information with no further involvement from the 
  10582.                     source window, though this rendering mechanism does allow 
  10583.                     for more interaction between the two windows should this be 
  10584.                     useful. 
  10585.  
  10586. DRM_DDE             The DDE rendering mechanism is intended for applications in 
  10587.                     which drag/drop actions will be used to set up DDE links 
  10588.                     between windows.  The DDE then proceeds according to 
  10589.                     standard DDE protocols. 
  10590.  
  10591. Further rendering mechanisms may be devised and documented for use by a 
  10592. particular user's applications.  The creation and use of rendering mechanisms 
  10593. is discussed in Using Rendering Mechanisms. 
  10594.  
  10595.  
  10596. ΓòÉΓòÉΓòÉ 18.2. Data Structures Used in Drag/Drop ΓòÉΓòÉΓòÉ
  10597.  
  10598. Three structures contain the data that travels with an item while it is being 
  10599. dragged; these are the DRAGINFO, DRAGITEM and DRAGIMAGE structures.  A further 
  10600. structure, the DRAGTRANSFER structure, is used to transfer information between 
  10601. source and target windows after a drop has occurred. 
  10602.  
  10603. Details of the fields within these structures can be found in the IBM OS/2 
  10604. Version 2.0 Presentation Manager Reference, and full descriptions will not be 
  10605. given here.  However, the following sections describe in general terms the kind 
  10606. of data the structures contain, and particularly certain critical fields. 
  10607.  
  10608.  
  10609. ΓòÉΓòÉΓòÉ 18.2.1. The DRAGINFO Structure ΓòÉΓòÉΓòÉ
  10610.  
  10611. The DRAGINFO structure contains information about the overall drag operation, 
  10612. which may consist of one or more dragitems.  Information in the DRAGINFO 
  10613. structure determines the source and type of the drag operation, and provides 
  10614. pointers to one or more DRAGITEM structures which identify individual 
  10615. dragitems. 
  10616.  
  10617. The handle of the source window for the drag operation is contained in the 
  10618. DRAGINFO structure.  This handle enables a target window which receives the 
  10619. structure to initiate a conversation with the source window if necessary, in 
  10620. order to exchange information. 
  10621.  
  10622. The other item of note in the DRAGINFO structure is a field which identifies 
  10623. the type of drag operation that the user has selected.  For example, a value of 
  10624. DO_COPY means that the user is holding the Ctrl key down, which by convention 
  10625. means that a copy operation is required.  The DO_DEFAULT value means that a 
  10626. default drag operation is to be used because the user is not holding down any 
  10627. modifier key. 
  10628.  
  10629. The DRAGINFO structure contains a counter that specifies how many dragitems are 
  10630. involved in the current operation.  This counter is then used to access an 
  10631. array of pointers, also contained within the DRAGINFO structure, which 
  10632. reference individual DRAGITEM structures for each dragitem. 
  10633.  
  10634. Note that the DRAGINFO structure must be accessible not only to the source 
  10635. window that sets it up in the first place, but also to any potential target 
  10636. windows.  Since these windows may not be owned by the same process, the 
  10637. DRAGINFO structure must be allocated in shared memory.  In order that the 
  10638. structure be correctly allocated and easily accessible by the system in order 
  10639. to provide it to potential target windows, OS/2 allocates the DRAGINFO 
  10640. structure on the application's behalf, using the DrgAllocDraginfo() function. 
  10641. This function is called by the source window when it is notified of a drag 
  10642. operation by receiving a WM_BEGINDRAG message. 
  10643.  
  10644. For Workplace Shell objects, the Workplace Shell handles the allocation and 
  10645. initialization of the DRAGINFO structure.  The object itself is not required to 
  10646. take any action with respect to this structure. 
  10647.  
  10648.  
  10649. ΓòÉΓòÉΓòÉ 18.2.2. The DRAGITEM Structure ΓòÉΓòÉΓòÉ
  10650.  
  10651. The DRAGITEM structure contains information about an individual dragitem. A 
  10652. drag operation may include one or more dragitems, and a separate DRAGITEM 
  10653. structure is used for each.  The number of dragitems, and an array of pointers 
  10654. to the DRAGITEM structures, is contained in the DRAGINFO structure.  In 
  10655. conjunction with the information contained in the DRAGINFO structure, the 
  10656. DRAGITEM structure provides the information required by a potential or actual 
  10657. target window, to determine whether a drop operation is valid for the dragitem. 
  10658.  
  10659. Several of the fields in the DRAGITEM structure are defined as being of type 
  10660. HSTR.  These fields refer to ordinary null-terminated character strings that 
  10661. are given string handles by Presentation Manager when the DrgAddStrHandle() 
  10662. function is called.  It is the string handles that are stored in the DRAGITEM 
  10663. structure; the strings themselves are stored by Presentation Manager and may be 
  10664. accessed by any other process that has access to the string handle, using the 
  10665. DrgQueryStrName() function. 
  10666.  
  10667. For Presentation Manager windows, the DRAGITEM structure is normally allocated 
  10668. by the source of the drag/drop operation as a local variable, since it only 
  10669. persists for the duration of the operation.  For Workplace Shell objects, the 
  10670. structure is allocated by the Workplace Shell and a pointer to it is passed to 
  10671. the object by the Workplace Shell when it invokes the object's 
  10672. _wpFormatDragItem method when the drag is initiated. 
  10673.  
  10674. A number of fields in the DRAGITEM structure are of primary importance; these 
  10675. fields are described in the following sections. 
  10676.  
  10677. lItemID 
  10678.  
  10679. This field contains a value provided by the source window, which uniquely 
  10680. identifies the dragitem.  For example, the value might be a listbox index 
  10681. value, a customer number, or any other value that is unique and meaningful to 
  10682. the source window.  The reason for having this identification is that later in 
  10683. the drag/drop processing, the target window may need to ask the source window 
  10684. for more information about the dragged item.  The identifier can then be used 
  10685. to identify the item concerned. 
  10686.  
  10687. hstrType and hstrRMF 
  10688.  
  10689. These values refer to character strings containing details of the type of data 
  10690. represented by the dragitem, and the rendering mechanisms and formats that the 
  10691. source is able support for the item.  The types correspond to the file type 
  10692. extended attribute, and are identified by names of the form DRT_xxxx; for 
  10693. example, DRT_TEXT for plain text, or DRT_BITMAP for bitmap data. 
  10694.  
  10695. The rendering mechanism is specified in the hstrRMF field, and may refer to any 
  10696. of the standard mechanisms described in Rendering Mechanisms, identified by the 
  10697. names DRM_PRINT, DRM_DISCARD, DRM_OS2FILE and DRM_DDE, or to any user-defined 
  10698. rendering mechanism for which a similar name should be defined.  More than one 
  10699. rendering mechanism can be specified; for example, a program that allows the 
  10700. dragging of files may allow the file to be moved or copied to another 
  10701. directory, or to be printed by being dropped on a printer object.  In this case 
  10702. the program would include the names of both the Print and OS/2 File rendering 
  10703. mechanisms in its hstrRMF string, allowing the target window to decide which is 
  10704. more suitable. 
  10705.  
  10706. The format specifications, which are also contained in the hstrRMF field, 
  10707. inform a target window of the data formats supported by the dragitem for each 
  10708. of its supported rendering mechanisms.  Data format names use the convention 
  10709. DRF_xxxx. 
  10710.  
  10711. To illustrate the use of format specifications and rendering mechanisms, 
  10712. consider a spreadsheet program that allows the user to drag an icon 
  10713. representing a particular spreadsheet; the user may choose to drag the data 
  10714. into a word-processor, into another spreadsheet, or onto a printer object for 
  10715. printing. For dragging the file to another spreadsheet or to a word-processing 
  10716. document, the DRM_OS2FILE rendering mechanism is appropriate but for dragging 
  10717. to a printer object, the DRM_PRINT mechanism is required.  In the case where 
  10718. the target is the printer or the word-processing document, clearly the required 
  10719. format for the data is text, but in the case of a drag to another spreadsheet 
  10720. it would be more convenient to have the numerical data and the cell 
  10721. relationships transferred too, so a different data format should be used, 
  10722. perhaps SYLK. 
  10723.  
  10724. The dragitem therefore needs to indicate that it supports the following 
  10725. rendering mechanism/data format combinations: 
  10726.  
  10727.  DRM_OS2FILE with DRF_TEXT 
  10728.  
  10729.  DRM_PRINT with DRF_TEXT 
  10730.  
  10731.  DRM_OS2FILE with DRF_SYLK. 
  10732.  
  10733. The hstrRMF string provides a syntax for defining this in a fairly 
  10734. straightforward way.  Complete details are given in the OS/2 2.0 Programming 
  10735. Guide Volume II but, for the above example, the hstrRMF string is as follows: 
  10736.  
  10737. <DRM_OS2FILE,DRF_TEXT>,<DRM_PRINT,DRF_TEXT>,<DRM_OS2FILE,DRF_SYLK>
  10738.  
  10739. This can be expressed slightly more concisely as: 
  10740.  
  10741. (DRM_OS2FILE,DRM_PRINT)x(DRF_TEXT),<DRM_OS2FILE,DRF_SYLK>
  10742.  
  10743. Here the first two bracketed items, connected with an "x", indicate that all 
  10744. possible pairs made up of one from the first bracket and one from the second, 
  10745. are implied.  This notation is very useful in more complex examples, where it 
  10746. can save the programmer from having to enumerate all possible combinations in 
  10747. the string. 
  10748.  
  10749. hstrContainerName, hstrSourceName, hstrTargetName 
  10750.  
  10751. The meaning of these three fields depends on the rendering mechanism to be 
  10752. used; with some rendering mechanisms, certain fields are not needed.  They 
  10753. apply most directly to the DRM_OS2FILE mechanism where they are used to define 
  10754. the source directory, source file name, and a suggested target filename (which 
  10755. may be overridden by the target window if it so chooses). 
  10756.  
  10757.  
  10758. ΓòÉΓòÉΓòÉ 18.2.3. The DRAGIMAGE Structure ΓòÉΓòÉΓòÉ
  10759.  
  10760. This structure, as its name suggests, contains information about the actual 
  10761. image to be displayed on the screen as the user performs the drag operation. 
  10762. In this structure, the source window specifies the icon or bitmap to be used, 
  10763. whether it is to be rescaled, and the coordinates of the hot spot. 
  10764.  
  10765.  
  10766. ΓòÉΓòÉΓòÉ 18.2.4. The DRAGTRANSFER Structure ΓòÉΓòÉΓòÉ
  10767.  
  10768. This structure is passed with a DM_RENDER message, from the target to the 
  10769. source window, after a drop has occurred.  It allows the target window to 
  10770. inform the source of several important things.  For example, where the source 
  10771. supports several different rendering mechanisms and/or formats, the target can 
  10772. specify which of these it wishes to use.  Similarly, if the source supports 
  10773. both copy and move operations, the target can specify which it will use by 
  10774. means of the usOperation field of this structure. 
  10775.  
  10776. Another important field is hstrRenderToName.  This tells the source window 
  10777. where to place the data, so that the target will know where to find it. The 
  10778. precise interpretation of this depends on the rendering mechanism; for example, 
  10779. in the case of the DRM_OS2FILE rendering mechanism, it contains the fully 
  10780. qualified name that the file is to be given at its destination. Where the 
  10781. transfer of information between source and target window is a simple memory 
  10782. transfer, this field may be used to contain the name of a named shared memory 
  10783. object into which the source is to place the data. 
  10784.  
  10785.  
  10786. ΓòÉΓòÉΓòÉ 18.3. Using Direct Manipulation ΓòÉΓòÉΓòÉ
  10787.  
  10788. The following sections use an example to illustrate the way in which direct 
  10789. manipulation can be used within a Presentation Manager application or a 
  10790. Workplace Shell  object. The example consists of a Customer program which reads 
  10791. and displays customer details.  Each customer is displayed as an object in a 
  10792. container window. 
  10793.  
  10794. The other component of the example is a Telephone program, which accepts 
  10795. customer information from the Customer program via drag/drop, and automatically 
  10796. dials the customer's telephone number.  The Telephone program communicates with 
  10797. the Customer program using a private rendering mechanism defined by the 
  10798. application.  This rendering mechanism uses shared memory, and is identified by 
  10799. the name DRM_SHAREMEM.  The rendering mechanism is explained in detail in 
  10800. Implementing a Private Rendering Mechanism. 
  10801.  
  10802. The example uses Presentation Manager windows as both the source and target for 
  10803. the drag/drop operation, since this enables a description of the complete set 
  10804. of steps required to complete the operation.  For Workplace Shell objects, 
  10805. certain steps are handled automatically by the Workplace Shell itself, and a 
  10806. Workplace Shell object class is therefore not required to carry out these 
  10807. steps.  Where a particular step is automated by the Workplace Shell, this is 
  10808. noted in the discussion. 
  10809.  
  10810.  
  10811. ΓòÉΓòÉΓòÉ 18.3.1. Initiating a Drag Operation ΓòÉΓòÉΓòÉ
  10812.  
  10813. A drag operation is initiated by the source window or object.  When the user 
  10814. starts the drag operation by pressing and holding down mouse button 2, 
  10815. Presentation Manager passes a WM_BEGINDRAG message to the window or object that 
  10816. is currently under the mouse pointer. In the case of a Presentation Manager 
  10817. window, the window procedure for that window may process the WM_BEGINDRAG 
  10818. message in order to initialize the DRAGINFO and DRAGITEM structures, and start 
  10819. the drag operation.  A Workplace Shell object is notified of a drag initiation 
  10820. by the Workplace Shell itself, which invokes the object's _wpFormatDragItem 
  10821. method. 
  10822.  
  10823. The initialization of a drag operation from a container window is shown in 
  10824. Figure "Drag Initiation From a Container Window". 
  10825.  
  10826. The code shown in Figure "Drag Initiation From a Container Window" would form 
  10827. part of the window procedure for the owner of the container control, since it 
  10828. is this window that would receive the WM_CONTROL message from the container. 
  10829.  
  10830. Initializing Data Structures 
  10831.  
  10832. When a WM_CONTROL message is received from a container window, a pointer to a 
  10833. CNRDRAGINIT structure is passed in the second parameter to the WM_CONTROL 
  10834. message.  This structure contains a pointer to the item within the container 
  10835. that the user is attempting to drag.  If this pointer is NULL, the user has 
  10836. attempted a drag operation while no item in the container was selected.  In the 
  10837. current example, the drag operation is ignored and control is immediately 
  10838. returned to Presentation Manager. 
  10839.  
  10840. The source window then allocates a DRAGINFO structure using the 
  10841. DrgAllocDraginfo() function.  The DRAGITEM structure is initialized with the 
  10842. appropriate values, and its pointer is set in the DRAGINFO structure using the 
  10843. DrgSetDragItem() function. All interaction with the DRAGINFO structure is 
  10844. performed using Presentation Manager functions, avoiding the necessity for the 
  10845. source window procedure to address the DRAGINFO structure directly. 
  10846.  
  10847. The DRAGIMAGE structure is then initialized with the information relating to 
  10848. the icon that will be displayed under the mouse pointer during the drag 
  10849. operation. 
  10850.  
  10851. For a Workplace Shell object, the Workplace Shell itself performs the 
  10852. initialization of the DRAGINFO structure.  The object may perform its own 
  10853. initialization of the DRAGITEM structure during processing of the 
  10854. _wpFormatDragItem method, if class-specific processing is required.  For 
  10855. example, if the object class implements a private rendering mechanism, the 
  10856. appropriate information must be entered into the correct fields in the DRAGITEM 
  10857. structure as part of the _wpFormatDragItem method. 
  10858.  
  10859. Note that a Workplace Shell object need not allocate the DRAGITEM structure, 
  10860. since the structure is already allocated by the Workplace Shell, and a pointer 
  10861. to the structure is passed to the _wpFormatDragItem method upon invocation. 
  10862.  
  10863. DrgDrag() Processing 
  10864.  
  10865. Once all data structures are allocated and initialized, the drag operation is 
  10866. initiated using the DrgDrag() function. This function is synchronous; it does 
  10867. not return control to the source window procedure until the key or mouse button 
  10868. specified in the fifth parameter (VK_ENDDRAG in the example above) is detected, 
  10869. and any synchronous message passing has been completed. 
  10870.  
  10871. At this point, the DrgDrag() function returns a window handle.  If the dragitem 
  10872. was dropped over a window or object that was able to accept the item, the 
  10873. window handle of the target window is returned.  If a drop occurred over an 
  10874. object that was unable to accept the item, a NULL window handle is returned. 
  10875.  
  10876. Upon return of control by the DrgDrag() function, the drag operation and the 
  10877. drop operation (if any) is complete, and the DRAGINFO structure can be released 
  10878. by the source window procedure. 
  10879.  
  10880. A Workplace Shell object is not required to invoke the DrgDrag() function, 
  10881. since this is performed automatically by the Workplace Shell when the object 
  10882. completes the processing of its _wpFormatDragItem method. 
  10883.  
  10884. Synchronous Message Processing During DrgDrag() 
  10885.  
  10886. When the user drops the dragitem over another window or object that is able to 
  10887. accept the item, a DM_DROP message is passed to the target, which then 
  10888. processes the drop operation.  Note that the target's DM_DROP message 
  10889. processing must complete and return control to Presentation Manager before the 
  10890. DrgDrag() function will return control to the source window procedure.  Thus 
  10891. any processing that is performed by the target window during its processing of 
  10892. the DM_DROP message is synchronous. 
  10893.  
  10894. The synchronous nature of this processing is necessary in order to ensure that 
  10895. the drop operation, and the accompanying transfer of information, is completed 
  10896. before the user performs any other operation.  For this reason, it is 
  10897. recommended that any messages passed by the target to the source window during 
  10898. processing of the DM_DROP message should be passed synchronously using the 
  10899. DrgSendTransferMsg() function. This is a departure from the normal Presentation 
  10900. Manager guidelines, where messages are processed asynchronously, but is 
  10901. required in order to ensure data integrity. 
  10902.  
  10903. A number of synchronous messages may be sent to the source window at the 
  10904. completion of a drop, prior to the DrgDrag() call returning control to the 
  10905. source window.  For example, if the user drops an object on a Workplace Shell 
  10906. printer object with the DRM_PRINT rendering mechanism specified, the target 
  10907. object sends a DM_PRINTOBJECT message to the source window.  This message 
  10908. contains sufficient information for the source window to direct a print data 
  10909. stream to the print queue represented by the printer object.  The first 
  10910. parameter in the DM_PRINTOBJECT message contains a pointer to the DRAGITEM 
  10911. structure that identifies the item being dropped, and the second parameter 
  10912. contains the name of the print queue for the printer object. 
  10913.  
  10914. An example of the way in which the source window procedure may process the 
  10915. DM_PRINTOBJECT message is shown in Figure "Receiving a DM_PRINTOBJECT Message". 
  10916.  
  10917. Note that the code that actually performs the printing operation has been 
  10918. omitted from Figure "Receiving a DM_PRINTOBJECT Message".  Printing under OS/2 
  10919. Version 2.0 and Presentation Manager is discussed in detail in OS/2 Version 2.0 
  10920. - Volume 5:  Print Subsystem, and examples are also provided in the PRTSAMP 
  10921. program included in the IBM Developer's Toolkit for OS/2 2.0. 
  10922.  
  10923.  
  10924. ΓòÉΓòÉΓòÉ 18.3.2. Dragging Over a Window ΓòÉΓòÉΓòÉ
  10925.  
  10926. While the dragitem is being dragged, Presentation Manager sends a succession of 
  10927. DM_DRAGOVER messages to the Presentation Manager window under the mouse 
  10928. pointer; one message is sent for every mouse movement. The DM_DRAGOVER message 
  10929. informs the target window that it is being dragged over, and allows it to 
  10930. access sufficient information to allow the window to decide whether it is able 
  10931. to accept a drop operation.  The window procedure indicates this to 
  10932. Presentation Manager by the value that it returns in response to the 
  10933. DM_DRAGOVER message. 
  10934.  
  10935. The information required by the window is contained in two data structures; the 
  10936. DRAGINFO structure, which is referenced by one of the parameters in the 
  10937. DM_DRAGOVER message, and the DRAGITEM structure, which can be accessed from the 
  10938. DRAGINFO structure.  Since multiple items may be dragged at the same time, the 
  10939. DRAGINFO structure contains an array of pointers to DRAGITEM structures, one 
  10940. for each dragitem.  The DRAGINFO structure maintains a count of the number of 
  10941. dragitems. 
  10942.  
  10943. When a potential target is a Workplace Shell object, the Workplace Shell 
  10944. notifies the object that a dragitem is being dragged over it, by invoking the 
  10945. object's _wpDragOver method. The DRAGINFO structure is passed to the object as 
  10946. a parameter to this method.  Processing of the _wpDragOver method is very 
  10947. similar to that described below for Presentation Manager window procedures.  In 
  10948. normal circumstances, however, the _wpDragOver method is not overridden by an 
  10949. object class; the default processing supplied by the parent class is allowed to 
  10950. occur unless the object class supports private rendering mechanisms that must 
  10951. be explicitly checked against those supported by the dragitem. 
  10952.  
  10953. An example of the way in which a window procedure may process the DM_DRAGOVER 
  10954. message is shown in Figure "Handling the DM_DRAGOVER Message". 
  10955.  
  10956. The code shown in Figure "Handling the DM_DRAGOVER Message" is quite simple; 
  10957. the processing of the DM_DRAGOVER message is intended only to determine whether 
  10958. a drop operation is valid for the specified dragitem and the target window. 
  10959. First, access is gained to the DRAGINFO structure, which is referenced by the 
  10960. first parameter to the DM_DRGOVER message.  The DRAGINFO structure is then used 
  10961. to access the DRAGITEM structure, by means of the DrgQueryDragitemPtr() 
  10962. function. The window procedure then has access to all the information needed to 
  10963. determine the validity of a drop operation. 
  10964.  
  10965. In this particular case, the only type of dragitem that is acceptable to the 
  10966. target window is one that represents a customer object, using the specially 
  10967. defined DRM_SHAREMEM rendering mechanism.  The window procedure therefore uses 
  10968. the DrgVerifyRMF() function to check whether the dragitem supports this 
  10969. rendering mechanism and the data type required by it. 
  10970.  
  10971. According to the result returned by the DrgVerifyRMF() function, the window 
  10972. procedure returns either DOR_DROP, indicating that a drop is acceptable, or 
  10973. DOR_NEVERDROP, indicating that a drop is not acceptable and that there is no 
  10974. point in sending any more DM_DRAGOVER messages to this window.  A number of 
  10975. other valid returns are possible for the DM_DRAGOVER message; these are 
  10976. documented in the IBM OS/2 Version 2.0 Presentation Manager Reference. 
  10977. Irrespective of the return code, the DRAGINFO structure is released. 
  10978.  
  10979. If a window returns any return code other than DOR_DROP to this message, the 
  10980. icon seen by the user is automatically modified to show that a drop is not 
  10981. allowed, thereby providing instant visual feedback. 
  10982.  
  10983.  
  10984. ΓòÉΓòÉΓòÉ 18.3.3. Dropping an Object ΓòÉΓòÉΓòÉ
  10985.  
  10986. When the user drops a dragitem over a Presentation Manager window, the target 
  10987. receives a DM_DROP message.  The window procedure for the target may process 
  10988. that message in order to handle the drop operation, and may either complete the 
  10989. operation or initiate a conversation with the source window or object in order 
  10990. to do so, typically by sending it a DM_RENDER message, which ultimately will 
  10991. result in the data being transferred. 
  10992.  
  10993. When the user drops a dragitem over a Workplace Shell object, the Workplace 
  10994. Shell invokes that object's _wpDrop method. The processing of this method is 
  10995. very similar to that discussed below for the DM_DROP message.  However, object 
  10996. classes that do not implement private rendering mechanisms need not override 
  10997. the _wpDrop method; the default processing provided by the parent class may be 
  10998. allowed to occur. 
  10999.  
  11000. In the customer/phone dialler example, the only type of dragitem that the order 
  11001. program will accept is a customer object, which uses the application-defined 
  11002. DRM_SHAREMEM rendering mechanism.  The correct data type and rendering 
  11003. mechanism is verified by the target window procedure during processing of the 
  11004. DM_DRAGOVER message, so there is no need for further checking when the DM_DROP 
  11005. is processed.  Note however, that in a more sophisticated application, which 
  11006. supports multiple data types and rendering mechanisms, it may be necessary to 
  11007. perform more detailed checking. 
  11008.  
  11009. In Figure "Handling the DM_DROP Message", access must first be gained to the 
  11010. DRAGINFO and DRAGITEM structures.  This is achieved in a similar manner to that 
  11011. already described for the DM_DRAGOVER message.  Having gained access to these 
  11012. structures, a named shared memory object is then allocated, into which the 
  11013. source window will be asked to place the customer details. 
  11014.  
  11015. A DRAGTRANSFER structure is then allocated, in which information about the 
  11016. target's requirements can be passed to the source window.  This structure is 
  11017. similar to the DRAGINFO structure, in that it must be accessible from multiple 
  11018. processes.  It is therefore allocated using the DrgAllocDragtransfer() 
  11019. function, ensuring that the structure will be accessible to the source window, 
  11020. which may be in another process and therefore not have direct access to the 
  11021. target's private data areas. 
  11022.  
  11023. There are several important fields in this structure.  The target window 
  11024. procedure places a pointer to the DRAGITEM structure into the pditem field, 
  11025. thereby enabling the source to identify which item has been dropped.  The 
  11026. hstrSelectedRMF field is used to identify which rendering mechanism and data 
  11027. format is to be used for this target, from the selection offered by the source 
  11028. in the DRAGITEM structure.  The hstrRenderToName field is used in the 
  11029. DRM_SHAREMEM rendering mechanism to pass the name of the shared memory object 
  11030. to the source window. 
  11031.  
  11032. Once this structure has been completed with the necessary information, it is 
  11033. sent to the source window as part of a DM_RENDER message.  This message is 
  11034. passed to the source window using the DrgSendTransferMsg() function. This 
  11035. function should be used for drag/drop operations in preference to the 
  11036. WinSendMsg() function since, for a DM_RENDER message, it also grants access to 
  11037. the DRAGTRANSFER structure for the process that owns the window to which the 
  11038. message is being sent. 
  11039.  
  11040. In processing the DM_RENDER message, the source window copies the customer 
  11041. details into the shared memory so that when DrgSendTransferMsg() returns, the 
  11042. target window procedure may extract the data it needs.  A detailed explanation 
  11043. of the source window's processing of a DM_RENDER message is given in 
  11044. Transferring Information. 
  11045.  
  11046. Upon completion of the information transfer, the entire drag/drop operation is 
  11047. complete and the data structures allocated during the operation may be 
  11048. released.  For the DRAGINFO and DRAGTRANSFER structures, this must be carried 
  11049. out using the DrgFreeDraginfo() and DrgFreeDragtransfer() functions. 
  11050.  
  11051.  
  11052. ΓòÉΓòÉΓòÉ 18.3.4. Transferring Information ΓòÉΓòÉΓòÉ
  11053.  
  11054. As explained in Dropping an Object, a target window may send a DM_RENDER 
  11055. message to the source when it receives a DM_DROP message from Presentation 
  11056. Manager.  Similarly, a Workplace Shell object may send the same message when 
  11057. its _wpDrop method is invoked by the Workplace Shell.  This message is normally 
  11058. sent to the source when the target requires the assistance of the source in 
  11059. completing the transfer of data as part of the drop operation. 
  11060.  
  11061. The source window processes this message in its window procedure, according to 
  11062. the rendering mechanism requested by the target.  If the source is a Workplace 
  11063. Shell object, the Workplace Shell will directly invoke the object's _wpRender 
  11064. method to perform the same function.  In most cases, however, an object does 
  11065. not need to override the _wpRender method unless it wishes to implement a 
  11066. private rendering mechanism. 
  11067.  
  11068. The DM_RENDER processing from the Customer program is shown in Figure "Handling 
  11069. the DM_RENDER Message". 
  11070.  
  11071. The first parameter to the DM_RENDER message contains a pointer to the 
  11072. DRAGTRANSFER structure, which in turn contains a pointer to the DRAGITEM 
  11073. structure in its pditem field.  For a Workplace Shell object, a pointer to the 
  11074. DRAGTRANSFER structure is passed as a parameter to the _wpRender method. 
  11075.  
  11076. In the DRM_SHAREMEM rendering mechanism, the ulItemID field in the DRAGITEM 
  11077. structure is used to hold a pointer to the customer container record (of type 
  11078. CONTRECORD), in whch the cust field is a CUSTOMER structure containing details 
  11079. of the customer object which was dragged. 
  11080.  
  11081. Next, the name of the shared memory object previously allocated by the target 
  11082. window is retrieved from the hstrRenderToName field of the DRAGTRANSFER 
  11083. structure.  This name is used to obtain access to the shared memory object. 
  11084. The customer details are copied into this memory object, after which the memory 
  11085. object is freed. 
  11086.  
  11087. The operation code in the DRAGTRANSFER structure is then checked to establish 
  11088. whether the target requires a copy or a move operation.  If a move was 
  11089. requested, the source program deletes the customer record from the contaiiner 
  11090. by calling an application subroutine named RemoveCustomer(). 
  11091.  
  11092. The window procedure then returns the value TRUE, indicating that the data was 
  11093. successfully rendered.  This value is returned to the target window procedure 
  11094. that issued the DrgSendTransferMsg() call. At this point, the target window 
  11095. procedure has access to all information required to complete the drop 
  11096. operation, and may do so without further communication. 
  11097.  
  11098. At the completion of the rendering procedure, the source may pass a 
  11099. DM_RENDERCOMPLETE message to the target, allowing the target to release any 
  11100. resources still outstanding.  A Presentation Manager window may process this 
  11101. message in its window procedure, while a Workplace Shell object is notified of 
  11102. the event by the Workplace Shell, which invokes the object's _wpRenderComplete 
  11103. method. This is usually only required in cases where complex private rendering 
  11104. mechanisms involve multiple transfers.  It is not used in the above examples. 
  11105.  
  11106.  
  11107. ΓòÉΓòÉΓòÉ 18.4. Using Rendering Mechanisms ΓòÉΓòÉΓòÉ
  11108.  
  11109. The rendering mechanism is essentially a protocol that determines the contents 
  11110. of several fields in the DRAGITEM structure.  These fields are: 
  11111.  
  11112.  ulItemID, which contains an application-specific value uniquely identifying 
  11113.   the item being dragged. 
  11114.  
  11115.  hstrType, which contains a handle to a string defining the data type of the 
  11116.   dragitem. 
  11117.  
  11118.  hstrRMF, which contains a handle to a string containing the names of all 
  11119.   rendering mechanisms supported by the dragitem, and the data formats 
  11120.   supported by those rendering mechanisms. 
  11121.  
  11122.  hstrContainerName, hstrSourceName and hstrTargetName, which contain handles 
  11123.   to strings used by the DRM_OS2FILE rendering mechanism, and may be used by 
  11124.   private rendering mechanisms to contain string data. 
  11125.  
  11126. The content of the hstrRMF field should obey a set of syntactical rules that 
  11127. are explained in the OS/2 2.0 Programming Guide Volume II.  Other fields in the 
  11128. DRAGITEM structure may also be used by particular rendering mechanisms; their 
  11129. use is dependent upon the individual rendering mechanism in use at the time. 
  11130. Applications may use one of the standard rendering mechanisms DRM_PRINT, 
  11131. DRM_DISCARD, DRM_OS2FILE or DRM_DDE, or may define their own rendering 
  11132. mechanisms to support dragging and dropping of particular dragitems. 
  11133.  
  11134.  
  11135. ΓòÉΓòÉΓòÉ 18.4.1. Standard Rendering Mechanisms ΓòÉΓòÉΓòÉ
  11136.  
  11137. The following sections describe the use of two of the standard rendering 
  11138. mechanisms, DRM_PRINT and DRM_OS2FILE.  These mechanisms can be used by 
  11139. Presentation Manager applications to interact with other applications and/or 
  11140. Workplace Shell  objects. 
  11141.  
  11142. DRM_PRINT 
  11143.  
  11144. For Presentation Manager applications running on the Workplace Shell desktop 
  11145. under OS/2 Version 2.0, it may be desirable to allow the user to print from the 
  11146. program by dragging the relevant item, such as a customer record, onto a 
  11147. Workplace Shell printer object. Since all Workplace Shell printer objects are 
  11148. written to understand the DRM_PRINT rendering mechanism, a Presentation Manager 
  11149. may provide such function simply by adhering to this mechanism. 
  11150.  
  11151. With the DRM_PRINT rendering mechanism, responsibility for actually carrying 
  11152. out the printing rests within the source window.  The source window must: 
  11153.  
  11154.  1. Detect the fact that a drag is being initiated by the user 
  11155.  
  11156.  2. Allocate and fill the DRAGINFO and DRAGITEM structures 
  11157.  
  11158.  3. Start the drag operation using the DrgDrag() function 
  11159.  
  11160.  4. Process the DM_PRINTOBJECT message which is returned by the target printer 
  11161.     object. 
  11162.  
  11163. The first three steps are handled in exactly the same way as illustrated in 
  11164. Figure "Drag Initiation From a Container Window".  Note that a view of a 
  11165. Workplace Shell object need not explicitly handle Presentation Manager messages 
  11166. in the window procedures for its views.  When the user initiates a drag from 
  11167. within a Workplace Shell object such as a folder or work area, the object is 
  11168. notified by the Workplace Shell, which invokes the object's _wpFormatDragItem 
  11169. method.  This method is processed in an identical manner to that shown for the 
  11170. window procedure in Figure "Drag Initiation From a Container Window". 
  11171.  
  11172. The final step is handled by processing the DM_PRINTOBJECT message in the 
  11173. source window procedure.  A simple example of such processing is shown in 
  11174. Figure "Receiving a DM_PRINTOBJECT Message". 
  11175.  
  11176. DRM_DISCARD 
  11177.  
  11178. The DRM_DISCARD rendering mechanism operates in a similar fashion to the 
  11179. DRM_PRINT mechanism, and is intended for use by applications which create their 
  11180. own equivalent to the Workplace Shell Shredder object.  In this rendering 
  11181. mechanism, the target passes a DM_DISCARDOBJECT message to the source, which 
  11182. may either accept responsibility for the discard operation, abort the 
  11183. operation, or allow the system to perform the operation. 
  11184.  
  11185. Note that the system may only discard objects which are capable of being 
  11186. rendered with the DRM_OS2FILE rendering mechanism; that is, program files and 
  11187. data files.  Other objects not based upon files must be explicitly discarded by 
  11188. the source. 
  11189.  
  11190. When a Workplace Shell object is dropped on the Shredder object, the Workplace 
  11191. Shell intercepts the DM_DISCARDOBJECT message and invokes the source object's 
  11192. wpDelete method. 
  11193.  
  11194. DRM_OS2FILE 
  11195.  
  11196. The DRM_OS2FILE rendering mechanism is designed to support moving and copying 
  11197. file objects between containers.  This rendering mechanism is described in 
  11198. detail in the OS/2 2.0 Programming Guide Volume II, and an extensive example is 
  11199. provided in the IBM Developer's Toolkit for OS/2 2.0.  The details of 
  11200. programming for the DRM_OS2FILE mechanism will therefore not be described 
  11201. further in this document. 
  11202.  
  11203. Certain fields in the DRAGITEM structure are designed specifically for this 
  11204. rendering mechanism; the hstrContainer, hstrSourceName and hstrTargetName 
  11205. fields are ideally suited to holding the source directory name, source file 
  11206. name, and fully qualified target file name respectively.  This is how these 
  11207. fields are used by the DRM_OS2FILE rendering mechanism. 
  11208.  
  11209. An alternative, and even more straightforward way to implement this rendering 
  11210. mechanism, is to use the DrgDragFiles() function.  This function automatically 
  11211. allocates and fills the required data structures for the source window, 
  11212. avoiding the need for the application to perform these functions and reducing 
  11213. the risk of error. 
  11214.  
  11215.  
  11216. ΓòÉΓòÉΓòÉ 18.4.2. Implementing a Private Rendering Mechanism ΓòÉΓòÉΓòÉ
  11217.  
  11218. The OS/2 2.0 Programming Guide Volume II gives some advice on use of the 
  11219. various messages available to implement a private rendering mechanism, and also 
  11220. some guidelines on how such a rendering mechanism should be documented.  This 
  11221. section illustrates the implementation of a simple rendering mechanism, by 
  11222. explaining the definition of the DRM_SHAREMEM rendering mechanism used by the 
  11223. examples earlier in this chapter. 
  11224.  
  11225. A rendering mechanism is necessary to pass the customer record data used in the 
  11226. examples, since the CUSTOMER structure that contains this data is too large to 
  11227. be contained within the DRAGITEM structure. It is therefore necessary, after a 
  11228. drop has occurred, for the source program to make the relevant data available 
  11229. to the target, in a format which is understood by and accessible to both the 
  11230. source and the target.  In the examples, a named shared memory object is used 
  11231. to transfer the data; hence the name DRM_SHAREMEM used for the rendering 
  11232. mechanism. 
  11233.  
  11234. The DRM_SHAREMEM rendering mechanism operates as follows: 
  11235.  
  11236.  The source window stores a pointer to the customer record being dragged in 
  11237.   the ulItemID field of the DRAGITEM structure.  This field is defined as 
  11238.   ULONG, but it can be used in any way that is meaningful to the source window 
  11239.   to identify the item being dragged.  A pointer to the customer record is a 
  11240.   convenient way to do this. 
  11241.  
  11242.  The target window, on receiving a DM_DROP message, allocates a named shared 
  11243.   memory object with a name of its choice.  It then sends a DM_RENDER message 
  11244.   to the source window, passing the name of the memory object in the 
  11245.   hstrRenderToName field of the DRAGTRANSFER structure, and indicating whether 
  11246.   it requires a copy (DO_COPY) or a move (DO_MOVE) to take place, using the 
  11247.   usOperation field of the DRAGTRANSFER structure. 
  11248.  
  11249.  When the source window receives the DM_RENDER message, it obtains access to 
  11250.   the shared memory object and places the customer record in that object.  The 
  11251.   source window knows which customer record to copy, since the DRAGITEM 
  11252.   structure, which includes a pointer to the customer record, is passed along 
  11253.   with the DRAGTRANSFER structure. 
  11254.  
  11255.   Finally, if a move operation was requested by the target, the source window 
  11256.   deletes the customer record from its own data. 
  11257.  
  11258.  On receiving a TRUE return code from the DM_RENDER message, indicating that 
  11259.   the data was successfully rendered, the target window copies the data out of 
  11260.   the shared memory object, and uses it in whatever way it chooses. 
  11261.  
  11262. It should be stressed that this is a very simple rendering mechanism. However, 
  11263. it illustrates the general structure of such mechanisms, and their impact on 
  11264. the contents of fields in the DRAGITEM and DRAGTRANSFER structures. 
  11265.  
  11266.  
  11267. ΓòÉΓòÉΓòÉ 18.5. Summary ΓòÉΓòÉΓòÉ
  11268.  
  11269. Direct manipulation is likely to become considerably more important to 
  11270. application designers than it has been in previous releases of OS/2, because of 
  11271. its central role in the object-oriented user interface provided by the 
  11272. Workplace Shell.  Even applications that are not implemented as Workplace Shell 
  11273. objects should provide, so far as is practical, a similar style of interface. 
  11274. Direct manipulation forms an essential part of such an interface. 
  11275.  
  11276. The programming facilities for direct manipulation in OS/2 V2.0 are essentially 
  11277. the same as those introduced in OS/2 Version 1.3, and consist of a set of 
  11278. message classes, functions and data structures, along with defined protocols 
  11279. known as rendering mechanisms, which define standard techniques for using these 
  11280. facilities to pass different types of information between diverse applications, 
  11281. and between user-developed applications and Workplace Shell objects such as 
  11282. printers and the shredder. 
  11283.  
  11284. User-defined rendering mechanisms may also be defined for specific purposes 
  11285. that are not covered by the standard ones.  The OS/2 2.0 Programming Guide 
  11286. Volume II gives guidance on this and on how such rendering mechanisms should be 
  11287. documented. 
  11288.  
  11289.  
  11290. ΓòÉΓòÉΓòÉ 19. Presentation Manager Resources ΓòÉΓòÉΓòÉ
  11291.  
  11292. The definition and use of Presentation Manager resources by applications was 
  11293. mentioned in The Presentation Manager Application Model.  The use of such 
  11294. resources greatly simplifies the task of the application developer in creating 
  11295. windows, menu bars, etc., and provides a powerful tool for the externalization 
  11296. of the user interface properties of an application object, thereby enabling 
  11297. easier modification of these properties during development or maintenance of 
  11298. the application.  This chapter will describe the definition of resources, and 
  11299. the ways in which resources may be used within a Presentation Manager 
  11300. application. 
  11301.  
  11302.  
  11303. ΓòÉΓòÉΓòÉ 19.1. Types of Resources ΓòÉΓòÉΓòÉ
  11304.  
  11305. A number of different types of resources may be defined for use by Presentation 
  11306. Manager applications.  These include text items such as menu bars and window 
  11307. templates, and graphical items such as graphics fonts, icons and bitmaps. 
  11308. Textual items are defined in the resource script file, which is described in 
  11309. Resource Script File.  Non-textual items are defined and saved in other files, 
  11310. and are referenced by statements in the resource script file.  The various 
  11311. types of Presentation Manager resource are described in the following sections. 
  11312.  
  11313.  
  11314. ΓòÉΓòÉΓòÉ 19.1.1. Fonts ΓòÉΓòÉΓòÉ
  11315.  
  11316. A font is a set of alphanumeric characters and other symbols.  Fonts may be 
  11317. designed interactively using the Font Editor application provided as part of 
  11318. the IBM Developer's Toolkit for OS/2 2.0.  Once a font has been designed, the 
  11319. Font Editor saves the font in a disk file with an extension .FNT.  This font 
  11320. file is referenced from the resource script file using the FONT keyword: 
  11321.  
  11322. FONT     123     MYFONT.FNT
  11323.  
  11324. The integer following the FONT keyword is used to identify the font resource. 
  11325. A symbolic name cannot be used to define a font resource. 
  11326.  
  11327. A font file must be link-edited along with a resource script file containing a 
  11328. FONT keyword referencing the .FNT file, and with the FONTS.OBJ and FONTS.DEF 
  11329. files provided with the OS/2 Programmer's Toolkit, to produce a file with an 
  11330. extension of .FON.  Although a font cannot be stored in a dynamic link library, 
  11331. the .FON file may be installed on the system by the user or installed 
  11332. explicitly by an application.  The font is then usable by any application in 
  11333. the system.  Alternatively, an application developer may choose not to install 
  11334. the font, but merely to access it from a particular application using the 
  11335. GpiLoadFonts() function. 
  11336.  
  11337.  
  11338. ΓòÉΓòÉΓòÉ 19.1.2. Icons, Pointers and Bitmaps ΓòÉΓòÉΓòÉ
  11339.  
  11340. As already mentioned, an icon is a graphical representation of an object on the 
  11341. screen.  For the purposes of discussion, icons, pointers and bitmaps will be 
  11342. grouped together; a pointer is a graphical image that is associated with a 
  11343. pointing device such as a mouse, and which moves on the screen as the pointing 
  11344. device is moved by the user, whereas a bitmap is a graphical image that 
  11345. typically is used to represent a general item such as a logo.  Icons, pointers 
  11346. and bitmaps may be designed interactively using the Icon Editor application 
  11347. supplied as part of the OS/2 Version 2.0 product.  Depending on which resource 
  11348. is being created, the Icon Editor saves the resulting icon, pointer or bitmap 
  11349. in a file with an extension of ICO, PTR or BMP.  These files are then 
  11350. referenced from the resource script file using the ICON, POINTER or BITMAP 
  11351. keywords: 
  11352.  
  11353. ICON     MAIN     APPLIC.ICO
  11354. POINTER  DRAW     PENCIL.PTR
  11355. BITMAP   INTRO    LOGO.BMP
  11356.  
  11357. The keyword is followed in each case by a resource identifier, which is a 
  11358. symbolic name used by the application to identify the resource.  For an icon, 
  11359. the identifier is used as a parameter to the WinCreateWindow() and 
  11360. WinCreateStdWindow() calls, and identifies the icon resource to be used when 
  11361. the FCF_ICON attribute is specified for the frame window.  In all cases, the 
  11362. symbolic name must be defined as an integer constant using a #define statement. 
  11363.  
  11364. For a pointer or bitmap, the identifier is used as a parameter to the 
  11365. WinLoadPointer() or GpiLoadBitmap() functions, which load the resource into 
  11366. memory.  WinLoadPointer() returns a pointer to the resource in memory, which 
  11367. may then be used as a parameter to the WinSetPointer() function, in order to 
  11368. set the desktop pointer to that resource. 
  11369.  
  11370. A pointer may be set to one of the system-defined pointer styles (such as an 
  11371. arrow or hourglass) using the WinSetPointer() function, by obtaining the handle 
  11372. of the required system pointer using the WinQuerySysPointer() function as 
  11373. follows: 
  11374.  
  11375. rc = WinSetPointer(HWND_DESKTOP,
  11376.                    WinQuerySysPointer(HWND_DESKTOP,
  11377.                                       SPTR_WAIT,
  11378.                                       FALSE));
  11379.  
  11380. This call will set the pointer for the desktop to the hourglass pointer 
  11381. (indicated by the symbolic name SPTR_WAIT).  The handle of the hourglass 
  11382. pointer is returned by the WinQuerySysPointer() call.  The symbolic names of 
  11383. the various system pointers are described along with the WinQuerySysPointer() 
  11384. function in the IBM OS/2 Version 2.0 Presentation Manager Reference. 
  11385.  
  11386. A bitmap is drawn within a window on the screen using the WinDrawBitmap() 
  11387. function.  The pointer to the bitmap, returned by GpiLoadBitmap() is passed as 
  11388. a parameter to WinDrawBitmap() in order to identify the resource. 
  11389.  
  11390.  
  11391. ΓòÉΓòÉΓòÉ 19.1.3. Menu Bars and Pulldown Menus ΓòÉΓòÉΓòÉ
  11392.  
  11393. Menu bars and their associated pulldown menus are defined within the resource 
  11394. script file, using the MENU and SUBMENU keywords.  A sample menu bar and 
  11395. pulldown menu definition is shown in Figure "Menu Bar Resource Definition". 
  11396.  
  11397. The symbolic name (MAIN in the example above) identifies the resource. This 
  11398. name is passed as a parameter to the WinCreateWindow() and WinCreateStdWindow() 
  11399. functions and identifies the menu bar resource when the FCF_MENU style frame 
  11400. control flag is specified for the frame window.  The PRELOAD option specifies 
  11401. that the resource will be incorporated into the application's main .EXE file, 
  11402. and is to be loaded immediately into memory, rather than being loaded when 
  11403. called by the application. 
  11404.  
  11405. The SUBMENU statement defines a menu bar entry that will be associated with a 
  11406. pulldown menu.  MENUITEM statements that are enclosed within the BEGIN and END 
  11407. markers of a SUBMENU statement define the pulldown menu items. MENUITEM 
  11408. statements that are not enclosed within the bounds of a SUBMENU statement 
  11409. define menu bar entries that do not have an associated pulldown menu. 
  11410.  
  11411. The text strings within quotation marks define the text for each menu bar or 
  11412. pulldown menu item.  The symbolic name following the text identifies the value 
  11413. (placed in the first message parameter) of the WM_COMMAND message generated 
  11414. when the item is selected.  The symbolic names following the message identifier 
  11415. define the style of the item.  In the example above, all items are simple text 
  11416. items and are defined with the style MIS_TEXT.  The sole exception is the final 
  11417. "Help" menu bar item, which is defined with the style attributes of MIS_HELP, 
  11418. which causes the item to generate a WM_HELP message rather than a WM_COMMAND 
  11419. message, and MIS_BUTTONSEPARATOR, which causes the item to be displayed on the 
  11420. right-hand side of the menu bar separated by a vertical bar, in accordance with 
  11421. SAA CUA guidelines.  The various item styles and attributes are documented in 
  11422. the IBM OS/2 Version 2.0 Presentation Manager Reference. 
  11423.  
  11424. When groups of items within a single pulldown menu are logically separate, they 
  11425. should be visually separated by a horizontal bar within the pulldown menu. 
  11426. This may be achieved using the SEPARATOR keyword in the MENUITEM statement, as 
  11427. follows: 
  11428.  
  11429. MENUITEM  SEPARATOR
  11430. The use of a separator bar in pulldown menus is particularly important when the 
  11431. pulldown menu is used to display a list of entries, comprised of multiple sets 
  11432. of mutually exclusive options, from which the user must select one option from 
  11433. each set.  In such a case, the separator bar is used to group the items within 
  11434. each set, and to visually separate the sets from one another. 
  11435.  
  11436. As already mentioned, menu bar resources are typically incorporated into a 
  11437. window by specifying their resource identifier in a WinCreateWindow() or 
  11438. WinCreateStdWindow() call, with the FCF_MENU frame creation flag set for the 
  11439. frame window.  A submenu within a menu bar resource may also be dynamically 
  11440. created using the WinCreateMenu() function, which is described in The Menu Bar. 
  11441.  
  11442. Mnemonics 
  11443.  
  11444. Mnemonics may be specified for menu bar and pulldown menu items.  A mnemonic is 
  11445. a key which, when combined with the F10 key, results in selection of the item. 
  11446. The character for the mnemonic must be part of the text for the item.  For 
  11447. example, the conventional mnemonic key for the "Exit" menu bar item is "x"; 
  11448. when the F10 key is pressed followed by the "x" key, a WM_COMMAND message with 
  11449. value MI_EXIT is generated. 
  11450.  
  11451. Mnemonics are indicated to the user by the appropriate character within the 
  11452. item text being underlined.  This is achieved by placing a tilde character (~) 
  11453. within the item text, immediately prior to the required character; for example: 
  11454.  
  11455. MENUITEM "E~xit",     MI_EXIT, MIS_TEXT
  11456.  
  11457. When the resource script file is compiled using the resource compiler, the menu 
  11458. bar item is created with the appropriate mnemonic. 
  11459.  
  11460. Accelerator Keys 
  11461.  
  11462. Accelerator keys or key sequences may be used to represent a pulldown menu item 
  11463. and provide a "fast path" to a particular command.  Note that accelerator keys 
  11464. are not used to represent menu bar entries, since the use of an accelerator key 
  11465. sequence is typically more complex than the use of a mouse or an F10 + single 
  11466. character operation.  The definition of accelerator keys is described in 
  11467. Accelerator Tables.  It is conventional to display an accelerator key sequence, 
  11468. along with the command represented by that sequence, in the pulldown menu, thus 
  11469. providing the user with a visual indication of the accelerator key sequence. 
  11470. This may be achieved by the use of the "\t" or "\a" control codes within the 
  11471. item text.  The "\t" code causes text to the right of the code to be 
  11472. left-justified in a new column, whereas the "\a" code causes text to the right 
  11473. of the code to be right-justified in a new column. 
  11474.  
  11475. To display an accelerator key sequence in a pulldown menu, it is conventional 
  11476. to use the "\t" control code.  For example: 
  11477.  
  11478. MENUITEM "~Tile\tShift+F5",     MI_TILE, MIS_TEXT
  11479.  
  11480. This would result in the item text "Tile" (with the "T" underscored to 
  11481. represent the mnemonic) being displayed in the left of the pulldown menu with 
  11482. the text "Shift+F5" being left-justified in a second column to the right of the 
  11483. item text. 
  11484.  
  11485.  
  11486. ΓòÉΓòÉΓòÉ 19.1.4. String Tables ΓòÉΓòÉΓòÉ
  11487.  
  11488. Tables of text strings may be defined within a resource script file for use by 
  11489. an application.  A string table is defined using the STRINGTABLE keyword, as 
  11490. shown in Figure "String Table Resource Definition". 
  11491.  
  11492. String tables may be used to contain titles, messages and other common text 
  11493. used by an application.  The external definition of these strings makes it easy 
  11494. to change a title or message without modifying source code.  String tables may 
  11495. also be used to contain menu bar or pulldown menu text for dynamic insertion by 
  11496. an application.  Special characters such as mnemonic indicators and tab 
  11497. characters for columnating display may be incorporated into the string 
  11498. definition. 
  11499.  
  11500. The symbolic name following the STRINGTABLE keyword identifies the string table 
  11501. and is used as a parameter when loading strings from the resource into 
  11502. application buffers using the WinLoadString() function.  The PRELOAD keyword 
  11503. specifies that the resource will be incorporated into the application's main 
  11504. .EXE file, and is to be loaded into memory immediately rather than being loaded 
  11505. when called by the application. 
  11506.  
  11507. Multiple string tables may be defined by an application.  Each string table 
  11508. must have its own symbolic name (note that the same name may be used for a 
  11509. string table and another type of resource such as a menu bar) and is enclosed 
  11510. within the BEGIN and END keywords of a STRINGTABLE statement. Each string has 
  11511. its own symbolic name within the string table. 
  11512.  
  11513. As mentioned above, strings are loaded from the string table into application 
  11514. buffers using the WinLoadString() function.  For example, to load the string 
  11515. STR_MAINTITLE from the string table MAIN into a buffer named szTitle, the 
  11516. function shown in Figure "Loading a Text String Resource" is used. 
  11517.  
  11518. The WinLoadString() function returns an unsigned integer representing the 
  11519. number of characters loaded into the target buffer.  Once loaded, the buffer 
  11520. may then be manipulated using standard programming language functions, or used 
  11521. as a parameter to other Presentation Manager function calls. 
  11522.  
  11523.  
  11524. ΓòÉΓòÉΓòÉ 19.1.5. Accelerator Tables ΓòÉΓòÉΓòÉ
  11525.  
  11526. Accelerator keys are single keys or key sequences that are used to represent a 
  11527. particular command (typically a pulldown menu item) within an application, and 
  11528. provide a fast path for the entry of that command.  Accelerators are defined 
  11529. for an individual window and are active whenever that window is active. 
  11530. According to Systems Application Architecture CUA conventions, accelerator keys 
  11531. should be indicated to the user by placing the accelerator key sequence 
  11532. alongside the command in the pulldown menu.  Accelerator keys are defined in 
  11533. the resource script file using the ACCELTABLE keyword, as shown in Figure 
  11534. "Accelerator Table Resource Definition". 
  11535.  
  11536. The symbolic name following the ACCELTABLE statement identifies the accelerator 
  11537. resource, and is passed as a parameter to the WinCreateWindow() or 
  11538. WinCreateStdWindow() functions when the FCF_ACCELTABLE style attribute is 
  11539. specified for the frame window. 
  11540.  
  11541. In the above example, the F3 key is defined as a virtual key that when pressed 
  11542. will generate a WM_COMMAND message with the value MI_EXIT.  This is equivalent 
  11543. to the user having selected the "Exit" option from the menu bar. The Shift+F5 
  11544. key sequence is also defined as a virtual key that will generate a WM_COMMAND 
  11545. message with the value MI_TILE.  Note that the shifted state of the key is 
  11546. indicated by use of the SHIFT option.  The Ctrl+D key sequence has also been 
  11547. defined to generate a WM_COMMAND message with the value MI_DELETE.  The Ctrl 
  11548. state of the key is indicated by the use of the CONTROL option (in a similar 
  11549. manner to the SHIFT option on the previous line).  The various options for 
  11550. defining accelerator keys are documented in the IBM OS/2 Version 2.0 
  11551. Presentation Manager Reference. 
  11552.  
  11553. As already mentioned, an accelerator table is associated with a particular 
  11554. window by specifying the resource identifier as a parameter to the 
  11555. WinCreateWindow() or WinCreateStdWindow() functions.  In addition, the 
  11556. WinLoadAccelTable() function may be used to dynamically load an accelerator 
  11557. table into memory. The WinLoadAccelTable() function returns the handle of the 
  11558. accelerator table in memory, which may then be passed as a parameter to the 
  11559. WinSetAccelTable() function to activate the accelerator table for a particular 
  11560. queue or window. 
  11561.  
  11562.  
  11563. ΓòÉΓòÉΓòÉ 19.1.6. Help Tables ΓòÉΓòÉΓòÉ
  11564.  
  11565. Help tables are used by the IPF to relate each display window, dialog box or 
  11566. control window to the help panel containing information about that window. 
  11567. Help tables and their definition are described in detail in Adding Online Help 
  11568. and Documentation. 
  11569.  
  11570.  
  11571. ΓòÉΓòÉΓòÉ 19.1.7. Window and Dialog Templates ΓòÉΓòÉΓòÉ
  11572.  
  11573. Templates defining standard windows and dialog boxes may be defined within the 
  11574. resource script file.  Typically, a window or dialog template is designed using 
  11575. the Dialog Box Editor application supplied with the IBM Developer's Toolkit for 
  11576. OS/2 2.0, and is saved in a text file with an extension .DLG which is included 
  11577. in the resource script file with an rcinclude statement.  A window or dialog 
  11578. template may also be defined directly into the resource script file.  In either 
  11579. case, the template is defined using the WINDOWTEMPLATE or DLGTEMPLATE keywords. 
  11580. These keywords are actually synonymous, and the resource compiler interprets 
  11581. either keyword in the same way. 
  11582.  
  11583. Within a single window or dialog template, there may be multiple WINDOW or 
  11584. DIALOG statements that define individual windows or dialog boxes.  The nesting 
  11585. of the statements defines the parent/child window hierarchy. Figure "Window 
  11586. Template Resource Definition" shows an example of nested windows within a 
  11587. window template. 
  11588.  
  11589. The window template WCP_001 contains a frame window with the title "Window 
  11590. Class X" and with size and positional coordinates as specified.  The style 
  11591. attributes of the frame window are specified using the CTLDATA statement.  The 
  11592. client window for this frame window is created using the WINDOW keyword nested 
  11593. within the window template, with no window title, the identifier FID_CLIENT, no 
  11594. size or positional coordinates (these are defined by the frame window), the 
  11595. class "MyClass" and the default client style. 
  11596.  
  11597. The use of the WINDOWTEMPLATE keyword and WINDOW statements is a useful way for 
  11598. an application developer to predefine particular window types and styles for 
  11599. use by one or more applications.  The template definitions may be used to 
  11600. create modal dialog boxes, which are loaded into memory and executed by the use 
  11601. of WinLoadDlg() and WinProcessDlg() calls.  Definitions may also be created for 
  11602. standard windows or modeless dialog boxes, which are loaded into memory using 
  11603. the WinLoadDlg() function and executed by making the window or dialog box 
  11604. visible using the WinShowWindow() function. 
  11605.  
  11606. Predefinition of windows is particularly useful when applied to dialog boxes. 
  11607. Here, the number and complexity of control window definitions is often such 
  11608. that creating such windows dynamically is a complicated task.  A dialog box is 
  11609. defined in the resource script file (or a .DLG file, which is incorporated into 
  11610. the resource script file using the rcinclude statement) using the DLGTEMPLATE 
  11611. keyword. 
  11612.  
  11613. Within a dialog template, there may be multiple dialogs defined using the 
  11614. DIALOG statement, and each dialog box may have multiple control windows defined 
  11615. using CONTROL keywords.  Figure "Dialog Template Resource Definition" shows an 
  11616. example of a dialog template containing a dialog box with several control 
  11617. windows: 
  11618.  
  11619. The dialog template is equivalent to a frame window, and is named DC_CREATE. 
  11620. This symbolic name is used to identify the dialog resource and is passed as a 
  11621. parameter to the WinDlgBox() function, which loads and processes the dialog 
  11622. box. 
  11623.  
  11624. The dialog box is defined with a title bar and a dialog border, and is also 
  11625. named using the symbolic name DC_CREATE.  The dialog box contains a static text 
  11626. control window providing instructions to the user, and an entry field into 
  11627. which the user may enter text.  It also contains an "Enter" and a "Cancel" 
  11628. pushbutton. 
  11629.  
  11630. Note that the resource identifier for the static text string does not use a 
  11631. symbolic constant, but simply has the value "-1".  This is done because there 
  11632. is no need for the application to access the text string; it is merely present 
  11633. as a prompt to the user.  It is therefore conventional to omit the symbolic 
  11634. constant and use "-1" as the value.  Multiple text strings may have the same 
  11635. value. 
  11636.  
  11637.  
  11638. ΓòÉΓòÉΓòÉ 19.2. Resource Script File ΓòÉΓòÉΓòÉ
  11639.  
  11640. The resource script file is an ASCII text file in which Presentation Manager 
  11641. resources are either defined or referenced.  A sample resource script file is 
  11642. given in Figure "Resource Script File". 
  11643.  
  11644. Note that the dialog templates are not defined directly in the resource script 
  11645. file, but are incorporated at the end of the resource script file using an 
  11646. rcinclude statement for the file mydlg.dlg. This is the typical way to 
  11647. incorporate dialog templates that are created by the Dialog Box Editor and 
  11648. stored in a DLG file. 
  11649.  
  11650. The resource script file has a number of #include statements at the start, 
  11651. similar to those typically found in C programs.  This is because the symbolic 
  11652. names used throughout the resource script file represent integer constants, and 
  11653. must be defined in the application's header file myappl.h. Other symbolic names 
  11654. may be used in the .DLG file, and must also be defined;  the header file 
  11655. mydlg.h for these symbolic names is generated by the Dialog Box Editor. 
  11656. Finally, a number of symbolic names such as DID_OK and DID_CANCEL are actually 
  11657. defined by Presentation Manager rather than by the application, and therefore 
  11658. the file os2.h is also required. 
  11659.  
  11660. The resource script file is used as input to the resource compiler provided as 
  11661. part of the IBM Developer's Toolkit for OS/2 2.0.  For further information on 
  11662. the resource compiler and its operation, see Resource Compilation. 
  11663.  
  11664.  
  11665. ΓòÉΓòÉΓòÉ 19.3. Using Resources ΓòÉΓòÉΓòÉ
  11666.  
  11667. As mentioned throughout this chapter, resources are typically loaded and used 
  11668. in an application by specifying the symbolic name of the resource as a 
  11669. parameter to a function that requires the resource.  The resource is then 
  11670. loaded and used by that function in performing its task.  However, there are 
  11671. several ways in which the resource may be loaded, depending upon where it 
  11672. resides.  These are discussed in the following sections. 
  11673.  
  11674.  
  11675. ΓòÉΓòÉΓòÉ 19.3.1. Loading From Within the Application ΓòÉΓòÉΓòÉ
  11676.  
  11677. In the typical case, resources are incorporated into an application by passing 
  11678. the resource script file to the resource compiler.  The resource compiler 
  11679. compiles the resource definitions and incorporates them into an executable file 
  11680. that has already been created. 
  11681.  
  11682. Many of the functions that require a resource identifier, such as 
  11683. WinLoadString() and WinLoadPointer(), also accept the identifier of a resource 
  11684. file as one of their parameters.  For resources that are incorporated into the 
  11685. application's .EXE file, this parameter should be specified as NULL.  For 
  11686. example, to load a pointer from a resource defined within the .EXE file, the 
  11687. following call is used: 
  11688.  
  11689. hPointer = WinLoadPointer(hDesktop,     /* Desktop handle           */
  11690.                           NULL,         /* Within .EXE file         */
  11691.                           DRAW);        /* Resource symbolic name   */
  11692.  
  11693. Other Presentation Manager functions that use this convention include 
  11694. WinLoadAccelTable(), WinLoadMenu() and WinCreateStdWindow(). 
  11695.  
  11696.  
  11697. ΓòÉΓòÉΓòÉ 19.3.2. Loading Resources From a DLL ΓòÉΓòÉΓòÉ
  11698.  
  11699. Presentation Manager resources may also be defined and stored in a dynamic link 
  11700. library. The process of compiling and placing resources in a DLL is described 
  11701. in Presentation Manager Resources in a DLL.  Once a resource is located in a 
  11702. DLL however, the DLL module must be loaded into memory by the application, and 
  11703. a module handle obtained at run time before the resource may be accessed by a 
  11704. Presentation Manager function.  This is typically achieved using the 
  11705. DosLoadModule() or DosGetModuleHandle() functions. Figure "Loading Resources 
  11706. From a DLL" illustrates the necessary code to load a dynamic link library named 
  11707. MYDLL from a directory identified in the LIBPATH statement in CONFIG.SYS, and 
  11708. to load a string resource from this DLL. 
  11709.  
  11710. The DosLoadModule() function call loads the dynamic link library with the name 
  11711. "MYDLL" (the default extension of .DLL is assumed) into memory and returns a 
  11712. handle hModule of type HMODULE.  This handle is then passed as the resource 
  11713. file identifier to the WinLoadString() function call, which accesses the 
  11714. resources within the module.  Other function calls such as WinLoadPointer() 
  11715. work in a similar manner. 
  11716.  
  11717.  
  11718. ΓòÉΓòÉΓòÉ 19.3.3. Loading Dialogs From a DLL ΓòÉΓòÉΓòÉ
  11719.  
  11720. The WinDlgBox() function also allows a DLL module handle to be specified, and 
  11721. thus enables dialog template definitions to be loaded from a DLL. For instance, 
  11722. to load and create a dialog box from a dialog template resource DC_001 defined 
  11723. in a DLL module named WINDLL.DLL, the following call sequence is used: 
  11724.  
  11725. rc = DosLoadModule(NULL,                  /* No object name           */
  11726.                    0,                     /* No object length         */
  11727.                    "MYDLL",               /* DLL module name          */
  11728.                    hModule);              /* DLL handle (returned)    */
  11729.  
  11730. rc = WinDlgBox(hDesktop,                  /* Desktop is parent        */
  11731.                hFrame,                    /* Frame is owner           */
  11732.                dpProc001,                 /* Dialog procedure address */
  11733.                hModule,                   /* DLL module handle        */
  11734.                DC_001,                    /* Resource ID within DLL   */
  11735.                NULL);                     /* No create parameters     */
  11736.  
  11737. Note that if the dialog procedure dpProc001 to be associated with this dialog 
  11738. box is also defined within the DLL module, the address of this procedure must 
  11739. be obtained by the application before the WinDlgBox() call is issued.  This is 
  11740. achieved using the DosGetProcAddr() function, which returns the address of the 
  11741. required function, as shown in the following example: 
  11742.  
  11743. rc = DosGetProcAddr(hModule,
  11744.                     "Proc1",
  11745.                     dpProc001);
  11746.  
  11747. In this case, Proc1 is the name of the required entry point in the DLL module, 
  11748. and dpProc001 is a variable of type PFNWP which contains the address of the 
  11749. procedure returned by the DosGetProcAddr() call.  While the address of the 
  11750. dialog procedure could have been supplied implicitly by using load-time rather 
  11751. than run-time dynamic linking, run-time dynamic linking is necessary to load 
  11752. the dialog box resource, and it is logical to place the resource and its 
  11753. associated dialog procedure in the same DLL module.  An example of the complete 
  11754. procedure required to load a dialog box from a DLL is given in Figure "Loading 
  11755. a Dialog Resource From a DLL". 
  11756.  
  11757. When loading dialogs from DLL modules, it is recommended that a combination of 
  11758. load-time and run-time dynamic linking techniques be used.  A calling routine 
  11759. should be placed in the DLL which, in response to an application request, loads 
  11760. and obtains the appropriate module handle, obtains the required dialog 
  11761. procedure address and executes the dialog.  This relieves the application of 
  11762. the responsibility for loading the dynamically-linked resources and routines. 
  11763. An example of such a routine is given in Figure "Loading a Dialog Resource From 
  11764. a DLL".  The calling routine CustInfoDlg is defined as an entry point within 
  11765. the DLL module, since it will be called from the application's main executable 
  11766. module.  An import library is then built for the DLL, and linked with the 
  11767. application code using standard conventions for load-time dynamic linking. 
  11768.  
  11769. When CustInfoDlg is invoked by the application, it obtains a module handle for 
  11770. its own DLL module, which has already been loaded when the call to CustInfoDlg 
  11771. was made, and uses this handle to obtain the address of the required dialog 
  11772. procedure using standard run-time dynamic linking conventions.  It then issues 
  11773. a WinDlgBox() call to load and process the dialog box, and returns the result 
  11774. to the application.  This example illustrates the combination of load-time and 
  11775. run-time dynamic linking conventions. 
  11776.  
  11777.  
  11778. ΓòÉΓòÉΓòÉ 19.4. Resources and National Language Support ΓòÉΓòÉΓòÉ
  11779.  
  11780. Since Presentation Manager resources provide the ability to define all the user 
  11781. interface properties of a Presentation Manager application, externally to the 
  11782. application code, they provide a useful means for implementing national 
  11783. language support within Presentation Manager applications.  Resources may be 
  11784. used to define: 
  11785.  
  11786.  Window titles 
  11787.  Menu bar and pulldown menu entries, including mnemonics and accelerator keys 
  11788.  Dialogs 
  11789.  Messages 
  11790.  Symbols such as icons and pointers. 
  11791.  
  11792. In short, all of the language-specific properties of an application may be 
  11793. defined using Presentation Manager resources.  Icons and other graphical 
  11794. symbols used by the user interface may also be tailored to suit different 
  11795. cultures where such symbols may have different meanings. 
  11796.  
  11797. The set of resources for each national language may be compiled and 
  11798. incorporated into a separate dynamic link library, which may be accessed by the 
  11799. application in order to load the required resources, as described in Loading 
  11800. Dialogs From a DLL.  The resource identifiers must, of course, be identical in 
  11801. each DLL.  Upon installation of the application on a workstation, an 
  11802. installation procedure can prompt the user to determine the required language, 
  11803. and install the appropriate DLL for that language. 
  11804.  
  11805. Where multiple languages must be supported in the same system, an application 
  11806. may query the codepage currently in use by its parent process using the 
  11807. WinQueryCp() function, and load resources from a specific DLL, depending upon 
  11808. the result of the function call.  While this method is by no means foolproof, 
  11809. it will suffice for many languages that use a single national codepage and 
  11810. single-byte characters. 
  11811.  
  11812.  
  11813. ΓòÉΓòÉΓòÉ 19.5. Summary ΓòÉΓòÉΓòÉ
  11814.  
  11815. It can be seen that Presentation Manager provides the mechanism by which an 
  11816. application developer may externally define the user interface properties of 
  11817. his/her application.  This ability provides the benefit that these external 
  11818. properties may be modified, or different versions substituted, without the need 
  11819. to modify the application code itself.  In addition, standard user interface 
  11820. objects such as icons, pointers and dialog boxes, along with their associated 
  11821. dialog routines, may be defined and stored in dynamic link libraries for use by 
  11822. multiple applications. 
  11823.  
  11824. Resources are defined using a resource script file, which is an ASCII text file 
  11825. containing definitions for text-based resources and references to other files 
  11826. that contain definitions for non-textual resources such as pointers and icons. 
  11827. The resource script file is used as input to the resource compiler, which 
  11828. compiles resource definitions and incorporates them into an executable module. 
  11829.  
  11830. Resources may be incorporated into the application's main .EXE file, or may be 
  11831. stored in a dynamic link library and loaded into memory using run-time dynamic 
  11832. linking.  Application procedures such as dialog procedures, which are 
  11833. associated with such resources, may also be defined and stored in the same DLL 
  11834. module, thus providing the opportunity to create libraries of standard 
  11835. resources, including standard dialogs, which may be used by multiple 
  11836. applications. 
  11837.  
  11838.  
  11839. ΓòÉΓòÉΓòÉ 20. Multitasking Considerations ΓòÉΓòÉΓòÉ
  11840.  
  11841. Systems Application Architecture CUA guidelines recommend that an application 
  11842. should complete  the processing of a user- or system-initiated event within 0.1 
  11843. seconds and be ready to continue interaction with the end user.  The particular 
  11844. implementation of the message handling concept under Presentation Manager means 
  11845. that  the application's primary thread must complete the processing of a 
  11846. Presentation Manager message before any further messages can be passed to 
  11847. applications; thus it is possible for the user to be "locked out" of the system 
  11848. if an application does not complete its processing within a reasonable period 
  11849. of time. 
  11850.  
  11851. While the 0.1 second time period is adequate for the processing of most events, 
  11852. it may be insufficient for those that result in lengthy processing such as 
  11853. access to a remote system.  It is therefore recommended that any window 
  11854. procedure performing some processing that is likely to take longer than 0.1 
  11855. seconds to complete should carry out this processing using a separate thread of 
  11856. execution under OS/2.  The application's primary thread may then initiate the 
  11857. secondary thread and immediately return control to Presentation Manager, 
  11858. thereby enabling the primary thread to continue with user interaction. 
  11859.  
  11860. The separation of processing into a primary and one or more  secondary threads 
  11861. may occur in a number of ways: 
  11862.  
  11863.  Where the window procedure is an object window procedure, and the majority of 
  11864.   its methods may result in lengthy processing, the window procedure itself may 
  11865.   be implemented in a secondary thread. 
  11866.  
  11867.  Where only a single method results in lengthy processing, or where  the 
  11868.   window procedure is concerned with a display object, a single subroutine 
  11869.   containing that method may be started in a secondary thread. 
  11870.  
  11871. In certain circumstances where the different portions of an  application's task 
  11872. are entirely self-contained, and where it is  desirable to isolate the portions 
  11873. from one another, the application may  be divided into separate processes. 
  11874. Division of the application in this way means that each portion resides and 
  11875. executes in its own address space, fully protected from other  portions of the 
  11876. application.  This approach is particularly useful for  applications that 
  11877. exploit the Workplace Shell, since the implementation of the  Workplace Shell 
  11878. in OS/2 Version 2.0 causes Workplace Shell objects to execute, by default, 
  11879. under the  control of the Workplace Shell process.  The use of multiple 
  11880. processes within an  application provides better protection for resources used 
  11881. by Workplace Shell  objects. 
  11882.  
  11883. Note that for performance reasons, the use of multiple threads  within the same 
  11884. process is preferable to the use of multiple  processes.  This is because 
  11885. switching between threads involves far less  system overhead than switching 
  11886. between processes. 
  11887.  
  11888. Processes and threads may communicate with one another in a number  of ways for 
  11889. the purposes of exchanging information, and for  synchronizing execution flow 
  11890. and access to data objects.  The  techniques of communication between threads 
  11891. and processes are described  in Communicating With a Secondary Thread and 
  11892. Communicating With Another Process. 
  11893.  
  11894. Maintaining synchronization between threads and processes is discussed in 
  11895. Maintaining Synchronization. 
  11896.  
  11897.  
  11898. ΓòÉΓòÉΓòÉ 20.1. Creating a Secondary Thread ΓòÉΓòÉΓòÉ
  11899.  
  11900. In Application Structure, it is mentioned that an application must  create its 
  11901. own input message queue to process messages intended for its windows.  The 
  11902. Presentation Manager message-handling implementation creates message queues on 
  11903. a per-thread basis, and thus requires that any thread that creates a window 
  11904. (whether that window is a display window or an object window) and processes 
  11905. messages must have its own message queue. 
  11906.  
  11907. The primary thread of an application is typically a user interface  thread that 
  11908. handles processing for display windows on the screen; this  thread creates the 
  11909. application's main message queue and processes  messages caused by user 
  11910. interaction.  The primary thread may also  create a secondary thread to deal 
  11911. with messages that cause lengthy  processing to be carried out, leaving the 
  11912. primary thread free to  respond to user input.  A secondary thread may be 
  11913. created in one of two  ways: 
  11914.  
  11915.  The _beginthread() function provided by the C compiler should be used to 
  11916.   create secondary threads that will contain object windows, or that contain 
  11917.   code which calls C run-time library functions.  This function maintains 
  11918.   certain internal C library control data that is, by default, not maintained 
  11919.   by the DosCreateThread() function. 
  11920.  
  11921.  The DosCreateThread() function provided by OS/2 may be used to create 
  11922.   secondary threads that will not contain object windows, and that do not call 
  11923.   C run-time library functions.  The DosCreateThread() function offers a 
  11924.   slight performance advantage over the _beginthread()  function. 
  11925.  
  11926. The _beginthread() function is used since it establishes  internal semaphores 
  11927. to serialize access to the run-time library's  global data and non-reentrant 
  11928. library functions, transparently to the  calling application. The 
  11929. _beginthread() function also  maintains information for each thread, such as 
  11930. the exception handling  environment and the calling address for reentrant 
  11931. functions.  Since  window procedures are reentrant, use of DosCreateThread() in 
  11932. such situations may cause execution errors. 
  11933.  
  11934. Whenever a thread is created, a thread information block  (TIB) is created by 
  11935. the operating system. The TIB contains information such as the thread ID, 
  11936. priority and stack size.  This information may be accessed by the application 
  11937. using the DosGetInfoBlocks() function.  This function also returns a pointer to 
  11938. information on the thread's parent process, which resides in the process 
  11939. information block (PIB). The DosGetInfoBlocks() function is described in the 
  11940. IBM OS/2 Version 2.0 Control Program Reference. 
  11941.  
  11942.  
  11943. ΓòÉΓòÉΓòÉ 20.1.1. Threads Containing Object Windows ΓòÉΓòÉΓòÉ
  11944.  
  11945. In the case where the processing of an event involves access to and 
  11946. manipulation of another data object, the secondary thread should create its own 
  11947. message queue and one or more object windows with window procedures to process 
  11948. any messages passed by the primary thread.  This technique preserves the 
  11949. object-oriented nature of the application by isolating data objects from one 
  11950. another. 
  11951.  
  11952. The primary thread then passes messages to the secondary thread's object 
  11953. windows, in an identical manner to that used when passing  messages to a window 
  11954. procedure in the primary thread; it is recommended that this be achieved using 
  11955. the WinPostMsg() function, since this call allows asynchronous processing of 
  11956. the message and preserves the correct serialization of messages in the system, 
  11957. as described in Window Procedures (Invoking a Window Procedure). 
  11958.  
  11959. Asynchronous threads with object windows are normally created by  window 
  11960. procedures in the application's primary thread issuing a _beginthread() 
  11961. function call.  This call is typically made  by a window procedure during its 
  11962. processing of the WM_CREATE message;  the secondary thread and its object 
  11963. window (or windows) are then  initialized and able to accept any requests 
  11964. passed to them.  An example  of the _beginthread() function is shown in Figure 
  11965. "Creating a Thread With an Object Window". 
  11966.  
  11967. Note that when using the IBM C Set/2 compiler, the second parameter in the 
  11968. _beginthread() function call (the pointer to the stack)  is ignored, since the 
  11969. _beginthread() function automatically  allocates memory for the stack. This 
  11970. parameter is included merely to allow source code compatibility with 
  11971. applications written for the earlier IBM C/2 and Microsoft C compilers, which 
  11972. required the  application to explicitly allocate stack space for a secondary 
  11973. thread.  Note that the minimum recommended stack size for a thread containing 
  11974. object windows is 8192 bytes (8 KB). 
  11975.  
  11976. The handle of the window from which the secondary thread is being created is 
  11977. passed to the thread in the _beginthread() call.  The secondary thread's main 
  11978. routine may then pass this handle to the object window created in the thread. 
  11979. Upon successful creation, the object window can then pass an acknowledgement 
  11980. message back to the window that created it, containing the handle of the object 
  11981. window, in order that the calling window may then post messages to the object 
  11982. window.  This acknowledgement message also ensures that the object window is 
  11983. correctly created and initialized before any messages are posted to it. 
  11984.  
  11985. The secondary thread's main routine is similar in structure to the main routine 
  11986. of the primary thread in a Presentation Manager application.  The main  routine 
  11987. registers the object window class, creates a window of that  class and enters a 
  11988. message processing loop. 
  11989.  
  11990. It should be noted that the secondary thread's main routine is  identical to 
  11991. that of the application's primary thread, with the  exception that a secondary 
  11992. thread need not register itself to Presentation Manager, since this is 
  11993. typically done once per application, by the primary thread.  However, if 
  11994. certain functions such as error processing are required on a per-thread basis, 
  11995. a separate anchor block must be created for the secondary thread, and hence an 
  11996. additional WinInitialize() call must be made. 
  11997.  
  11998. Figure "Secondary Thread Creating an Object Window" shows a secondary thread 
  11999. that registers an  object window class and creates a window of that class. 
  12000.  
  12001. An object window is created using the normal WinCreateWindow() call, as 
  12002. illustrated in Figure "Secondary Thread Creating an Object Window".  The 
  12003. window's parent is  specified as the conceptual object window, the handle of 
  12004. which is obtained from the WinQueryObjectWindow() function, or using the 
  12005. defined constant HWND_OBJECT.  Note that the  handle of the window that created 
  12006. the thread is passed to the object  window in the CtlData parameter of the 
  12007. WinCreateWindow() call, in order that the object window may pass its handle 
  12008. back to the calling window to indicate its readiness to receive messages. 
  12009.  
  12010. The secondary thread retrieves messages from its input queue in the 
  12011. conventional manner using WinGetMsg(), and invokes Presentation Manager  using 
  12012. WinDispatchMsg() to pass the message to its object window procedure.  Thus a 
  12013. secondary thread has a message processing loop similar to that of the 
  12014. application's (primary thread's) main routine. 
  12015.  
  12016. An object window procedure is identical in structure to a "normal" display 
  12017. window procedure.  An example of an object window  procedure is illustrated in 
  12018. Figure "Sample Object Window Procedure". 
  12019.  
  12020. Upon creation, an object window receives a WM_CREATE message in the same way as 
  12021. a standard window.  The window may capture and explicitly process this message 
  12022. in order to open or create data objects, initialize instance data, etc., as 
  12023. illustrated in Figure "Sample Object Window Procedure".  Once opened, however, 
  12024.  
  12025.  an object window typically only receives a number of application-defined
  12026. messages requesting certain actions on  data objects owned by the window. 
  12027.  
  12028. The object window procedure shown in Figure "Sample Object Window Procedure" 
  12029. also extracts the handle of the window that issued the WinCreateWindow() 
  12030. function call, which is normally passed to the object window as part of the 
  12031. WM_CREATE message.  The window procedure then uses this handle to send an 
  12032. acknowledgement message back to this window, containing its own window handle 
  12033. and thus enabling the two windows to communicate with one another.  This is 
  12034. necessary when object windows are created in secondary threads, as described in 
  12035. Communicating With a Secondary Thread.  Note that the object window procedure 
  12036. must use  the system linkage convention; this is achieved using the EXPENTRY 
  12037. keyword. 
  12038.  
  12039. The only other system-defined message class normally received by an  object 
  12040. window is the WM_DESTROY message class passed to the window by  Presentation 
  12041. Manager when a WinDestroyWindow() call is issued by the  thread.  An object 
  12042. window should respond to the WM_DESTROY message by  closing, destroying or 
  12043. freeing any data objects to which it has  obtained access, and backing out any 
  12044. uncommitted units of work. 
  12045.  
  12046. Figure "Sample Object Window Procedure" shows a number of application-defined 
  12047. message  classes being processed by the object window procedure.  These message 
  12048. classes are typically defined by the application during its initialization. 
  12049. For message classes that will be processed by an object window procedure loaded 
  12050. from a DLL module, the message classes should be defined in the include file 
  12051. for that DLL module, rather than explicitly within the application that uses 
  12052. the DLL module.  This further enhances the isolation of the internal workings 
  12053. of the object window from other components of the application, and facilitates 
  12054. reusability of the code. 
  12055.  
  12056. The window procedure in the primary thread must have some way of determining 
  12057. when the object window has completed its processing, at which point it may 
  12058. safely assume that the previous event has been processed successfully and allow 
  12059. the user to continue operating upon  the data object, or take appropriate error 
  12060. action.  This indication may  be provided in a number of ways, which are 
  12061. discussed in Maintaining Synchronization. 
  12062.  
  12063.  
  12064. ΓòÉΓòÉΓòÉ 20.1.2. Threads Without Object Windows ΓòÉΓòÉΓòÉ
  12065.  
  12066. When the processing to be performed within a secondary thread is limited in 
  12067. scope to the data objects "owned" by the current application object, an object 
  12068. window is not warranted.  A secondary thread without an object window is 
  12069. similar in both appearance and behavior to a normal subroutine. However, the 
  12070. routine executing in the secondary thread performs its tasks asynchronously to 
  12071. the primary thread, although it still has access to the same data objects. 
  12072. Such a thread is typically started when required by issuing a DosCreateThread() 
  12073. call from within a window procedure in the primary thread.  A sample invocation 
  12074. of such a thread is illustrated in Figure "Creating a Thread Without an Object 
  12075. Window". 
  12076.  
  12077. Two considerations arise when processing asynchronous threads  without the use 
  12078. of object windows: 
  12079.  
  12080.  The primary thread must not attempt to access a data object at the same time 
  12081.   as a secondary thread is updating that data object, since the state of the 
  12082.   data during the update is undetermined and unpredictable results could occur. 
  12083.  
  12084.  The primary thread must have some way of determining when the secondary 
  12085.   thread has completed its processing, at which point it may then access the 
  12086.   data objects that were manipulated by the secondary thread. 
  12087.  
  12088. These two conditions may be achieved by adopting a convention whereby a 
  12089. secondary thread has exclusive access to its data object(s) for the duration of 
  12090. its execution.  It is therefore only necessary for the  primary thread to 
  12091. determine when the secondary thread has completed  processing, at which point 
  12092. it may access the data objects. 
  12093.  
  12094. Where this is not possible, mutex semaphores may be used to  serialize access 
  12095. to resources such as data objects.  Each thread that  requires access must bid 
  12096. for the semaphore.  If the semaphore is  already held by another thread, the 
  12097. requesting thread must wait for  that thread to release the semaphore before 
  12098. attempting to access the  resource. 
  12099.  
  12100. A number of mechanisms for synchronizing execution and/or access to resources 
  12101. are described in Maintaining Synchronization. 
  12102.  
  12103.  
  12104. ΓòÉΓòÉΓòÉ 20.2. Creating Another Process ΓòÉΓòÉΓòÉ
  12105.  
  12106. Each application running under OS/2 typically resides in its own  process, and 
  12107. therefore has its own address space.  Resources created by  or allocated to a 
  12108. process are normally private to that process.  If  required for application 
  12109. purposes, this process may in turn create one  or more additional processes to 
  12110. perform part of the application's processing.  Additional processes  may be 
  12111. created in either of two ways: 
  12112.  
  12113.  As a child process of the creating process, in which case the child process 
  12114.   will automatically terminate upon termination of the creating process.  Such 
  12115.   processes are started using the DosExecPgm()  function. 
  12116.  
  12117.  As a separate process, in which case the process will not automatically 
  12118.   terminate when its creator terminates, and must be explicitly terminated 
  12119.   either by its creator or by another process in the system. Such a process is 
  12120.   started using the  DosStartSession() function. 
  12121.  
  12122. When an application uses multiple processes, it is usual for the first process 
  12123. to be regarded as the "primary" process for the  application, and for other 
  12124. processes to be started as children of this  process.  This is conceptually 
  12125. similar to the use of primary and  secondary threads. 
  12126.  
  12127. It is therefore conventional to use the DosExecPgm()  function to start a child 
  12128. process.  This function is illustrated in Figure "Starting a Child Process". 
  12129.  
  12130. The window handle of the window from which the DosExecPgm()  call is made, is 
  12131. passed to the child process as an argument, using the  the fourth parameter of 
  12132. the DosExecPgm() function.  This  enables the child process to post a message 
  12133. to its parent upon  completing its initialization, indicating the window handle 
  12134. of its own  window.  In this way, communication via Presentation Manager 
  12135. messages may be  established in both directions. 
  12136.  
  12137. Note that since the fourth parameter to the DosExecPgm()  function is defined 
  12138. as an ASCII string, the window handle is converted  to its ASCII equivalent 
  12139. before the call is issued.  The main routine of  the child process subsequently 
  12140. converts the handle back to its true  form. 
  12141.  
  12142. Use of the EXEC_ASYNCRESULT flag in the DosExecPgm() call  causes the operating 
  12143. system to save the termination codes of the child  process so that they may be 
  12144. examined at a later point by the parent  process, using a DosWaitChild() 
  12145. function call for  synchronization purposes (see Figure "DosWaitChild() 
  12146. Function" for further information). 
  12147.  
  12148. The process ID of the child process is returned by the  DosExecPgm() function 
  12149. as part of the RESULTCODES structure  in the sixth parameter. This value should 
  12150. be stored by the parent  process, since it is used if and when the parent 
  12151. process needs to  terminate the child at some later point during execution. 
  12152.  
  12153.  
  12154. ΓòÉΓòÉΓòÉ 20.3. Destroying a Secondary Thread ΓòÉΓòÉΓòÉ
  12155.  
  12156. Secondary threads should be terminated when they are no longer required, to 
  12157. reduce the context-switching  overhead of the operating system.  The method of 
  12158. termination depends  upon how the secondary thread was created, and whether or 
  12159. not it has  created object windows. 
  12160.  
  12161.  
  12162. ΓòÉΓòÉΓòÉ 20.3.1. Threads Containing Object Windows ΓòÉΓòÉΓòÉ
  12163.  
  12164. A secondary thread with an object window should be terminated by the window 
  12165. procedure in the primary thread that initially created the secondary thread. 
  12166. This is achieved simply by posting a WM_QUIT message to the object window, 
  12167. which will cause the message processing loop for the secondary thread to 
  12168. terminate. 
  12169.  
  12170. The thread's main routine then issues WinDestroyWindow() calls for its object 
  12171. windows.  These calls cause WM_DESTROY messages to be posted to the object 
  12172. windows, which will process these messages in order to close data objects, 
  12173. release any resources, etc., in accordance with established conventions. 
  12174.  
  12175. Once all data objects and other resources have been released or destroyed, the 
  12176. thread should terminate itself using the _endthread() function. The use of this 
  12177. function will ensure that the semaphores and control structures used by the 
  12178. _beginthread() function are correctly  reset. 
  12179.  
  12180.  
  12181. ΓòÉΓòÉΓòÉ 20.3.2. Threads Without Object Windows ΓòÉΓòÉΓòÉ
  12182.  
  12183. Secondary threads without object windows are typically created to  perform a 
  12184. lengthy processing operation within the scope of a single  event.  A window 
  12185. procedure under the control of the primary thread  creates the secondary thread 
  12186. to process a particular subroutine, and  the secondary thread terminates 
  12187. automatically when this subroutine  reaches an exit point.  However, the 
  12188. DosExit() function should be called as the last action in the secondary thread, 
  12189. in order  to ensure that the memory allocated for the thread's stack is 
  12190. correctly released by the operating system. 
  12191.  
  12192. However, some checks may be necessary to ensure orderly termination  of a 
  12193. secondary thread, particularly where access to data objects is  involved. Upon 
  12194. termination of an application's primary thread, all  secondary threads that 
  12195. have not already been terminated by the  application are forcibly terminated by 
  12196. OS/2.  Where the secondary  thread's processing involves a critical data 
  12197. operation such as the  update of a database, the primary thread should ensure 
  12198. that the  secondary thread has completed its processing before allowing itself 
  12199. to  terminate. 
  12200.  
  12201. It is recommended that before creating a secondary thread without an object 
  12202. window, a window procedure should set an event semaphore, and pass the handle 
  12203. of this semaphore to the secondary thread.  The event semaphore is then cleared 
  12204. by the secondary thread as the last action before it terminates. 
  12205.  
  12206. Upon receiving a WM_DESTROY message, the window procedure in the primary thread 
  12207. should test the state of the event semaphore and wait for the semaphore to 
  12208. clear before completing the WM_DESTROY message processing (which should include 
  12209. releasing the semaphore) and returning control to Presentation Manager.  This 
  12210. will ensure that the secondary thread terminates in an orderly manner before 
  12211. the primary thread is terminated. 
  12212.  
  12213. The use of event semaphores is described in more detail in Maintaining 
  12214. Synchronization. 
  12215.  
  12216.  
  12217. ΓòÉΓòÉΓòÉ 20.3.3. Forcing Termination of a Thread ΓòÉΓòÉΓòÉ
  12218.  
  12219. In certain circumstances, it may be necessary to terminate a secondary thread 
  12220. without waiting for the thread to complete its processing; for example, the 
  12221. user may decide to exit from the  application.  This capability is provided 
  12222. under OS/2 Version 2.0 using the DosKillThread() function.  This function is 
  12223. illustrated in Figure "DosKillThread() Function". 
  12224.  
  12225. Note that the DosKillThread() function cannot be used to  terminate the current 
  12226. thread; if the application attempts to issue a DosKillThread() function call 
  12227. for the current thread, the function will return an error. To terminate a 
  12228. secondary thread from within that thread, the _endthread() function should be 
  12229. used  if the thread was created with the _beginthread() function,  or the 
  12230. DosExit() function may be used if the thread was  created using the 
  12231. DosCreateThread() function. 
  12232.  
  12233.  
  12234. ΓòÉΓòÉΓòÉ 20.4. Terminating a Process ΓòÉΓòÉΓòÉ
  12235.  
  12236. A process may terminate another process running in the system, provided it has 
  12237. access to the process ID of the process it wishes to terminate.  This process 
  12238. ID is returned by the DosExecPgm() function when the process is created and 
  12239. since, in the majority of  cases, a process is terminated by the process that 
  12240. created it, this  presents no particular problem since the process ID can be 
  12241. stored as a  global variable or as instance data in window words, until it is 
  12242. needed  to terminate the process. 
  12243.  
  12244. A process is terminated using the DosKillProcess()  function.  This function 
  12245. may be used to terminate a single process, or  to terminate a process and all 
  12246. its descendants (that is, its children,  along with their children, and so on). 
  12247. An example of the  DosKillProcess() function is given in Figure "Terminating a 
  12248. Process". 
  12249.  
  12250. The value of "1" specified for the first parameter in the  DosKillProcess() 
  12251. call causes the function to terminate only  the specified process and not its 
  12252. descendants (if any). 
  12253.  
  12254.  
  12255. ΓòÉΓòÉΓòÉ 20.5. Communicating With a Secondary Thread ΓòÉΓòÉΓòÉ
  12256.  
  12257. The primary thread may wish to communicate with the secondary thread in order 
  12258. to initiate an event or transfer data.  The methods available for such 
  12259. communication differ, depending upon whether the secondary thread contains an 
  12260. object window. 
  12261.  
  12262.  
  12263. ΓòÉΓòÉΓòÉ 20.5.1. Threads Containing Object Windows ΓòÉΓòÉΓòÉ
  12264.  
  12265. When a secondary thread is created, and in turn creates an object window as 
  12266. shown in Figure "Secondary Thread Creating an Object Window", the handle of the 
  12267. calling window  may be passed to the object window as part of the WM_CREATE 
  12268. message, and the object window procedure uses this handle to pass its own 
  12269. window handle back to the calling window as part of an acknowledgement 
  12270. message.  This technique is illustrated in the sample object window procedure 
  12271. shown in Figure "Sample Object Window Procedure". 
  12272.  
  12273. Once the calling window receives this message and extracts the  object window's 
  12274. handle, it should store the handle in its own instance  data.  It may then use 
  12275. the handle at any time to pass a Presentation Manager message to the object 
  12276. window, in order to initiate an event in the object window. 
  12277.  
  12278. By convention, messages passed to an object window should contain the window 
  12279. handle of the calling window, within the message  parameters.  The object 
  12280. window procedure may then use this handle to pass an acknowledgement message or 
  12281. return data to the calling window in the primary thread.  This technique allows 
  12282. the same object window to process messages from multiple sources.  See 
  12283. Client-Server Applications for additional considerations. 
  12284.  
  12285. Note that messages passed to object windows in secondary threads  should be 
  12286. posted using the WinPostMsg() function,  rather than being sent using the 
  12287. WinSendMsg() function.  This causes asynchronous processing of the message, and 
  12288. allows the  primary thread to return to Presentation Manager and continue 
  12289. interaction with the  end user. 
  12290.  
  12291. In situations where the user must be prevented from carrying out  certain 
  12292. actions while the object window processes an event, the calling window 
  12293. procedure should disable those actions in the action bar immediately before 
  12294. posting the message to the object window, and re-enable those actions only 
  12295. after a completion message  has been received from the object window.  This 
  12296. prevents the user from  carrying out such actions, but does not prohibit other 
  12297. actions within the application, or interaction with other applications on the 
  12298. desktop. 
  12299.  
  12300.  
  12301. ΓòÉΓòÉΓòÉ 20.5.2. Threads Without Object Windows ΓòÉΓòÉΓòÉ
  12302.  
  12303. Where a secondary thread is created only to process a specific  event, and 
  12304. where the thread terminates upon completion of that event,  communication 
  12305. between the primary and secondary threads is usually not  required. Necessary 
  12306. data is communicated to the secondary thread as  part of the DosCreateThread() 
  12307. function, including pointers to the data objects upon which the thread must 
  12308. operate.  The secondary thread then proceeds to process the event, 
  12309. independently of the primary thread. 
  12310.  
  12311. The only communication from the secondary thread to the primary  thread occurs 
  12312. upon completion of the event, when the secondary thread  signals this 
  12313. completion to the primary thread.  Completion may be  signalled by Presentation 
  12314. Manager messages or via semaphores; see Maintaining Synchronization for further 
  12315. discussion. 
  12316.  
  12317.  
  12318. ΓòÉΓòÉΓòÉ 20.6. Communicating With Another Process ΓòÉΓòÉΓòÉ
  12319.  
  12320. Communication between processes must use one of the architected methods 
  12321. provided by OS/2, since the operating system by default prohibits different 
  12322. processes from accessing the same resources.  For this reason, communication 
  12323. between processes is slightly more complex than communication between threads, 
  12324. but requires less care on the part of the programmer to ensure synchronization 
  12325. and data integrity. 
  12326.  
  12327. The mechanisms provided by OS/2 for interprocess communication are: 
  12328.  
  12329.  Presentation Manager messages 
  12330.  Shared memory 
  12331.  Queues 
  12332.  Pipes (both named and anonymous) 
  12333.  Atoms 
  12334.  Dynamic data exchange (DDE). 
  12335.  
  12336. Each of these mechanisms is explained in detail in the  IBM OS/2 Version 2.0 
  12337. Application Design Guide, and simple examples are given in the following 
  12338. sections. 
  12339.  
  12340.  
  12341. ΓòÉΓòÉΓòÉ 20.6.1. Presentation Manager Messages ΓòÉΓòÉΓòÉ
  12342.  
  12343. When a child process creates its own windows, Presentation Manager messages can 
  12344. be  used to signal events and/or pass information between the parent and  child 
  12345. processes, provided the windows' handles are known to one another.  One 
  12346. technique for passing window handles during process creation is described in 
  12347. Creating Another Process.  Even where the child process does not create its 
  12348. own windows, it may use Presentation Manager messages to indicate events and 
  12349. pass  information to its parent process. 
  12350.  
  12351. The amount of information which can be passed in a Presentation Manager message 
  12352. is somewhat limited, due to the four-byte size of each message parameter.  The 
  12353. use of Presentation Manager messages for passing information is therefore 
  12354. typically combined with other mechanisms such as shared memory or atoms.  The 
  12355. message parameters are then used to carry pointers to shared memory objects, or 
  12356. string handles that are then used by the child process to access the required 
  12357. information. 
  12358.  
  12359.  
  12360. ΓòÉΓòÉΓòÉ 20.6.2. Shared Memory ΓòÉΓòÉΓòÉ
  12361.  
  12362. Shared memory objects may be allocated and used to pass information between 
  12363. specific processes.  Such memory objects may be named or anonymous. 
  12364.  
  12365. The example that follows assumes that two processes are created in the system: 
  12366. a client process that accepts user input and displays results, and a server 
  12367. process that accepts requests from the client,  accesses data objects and 
  12368. returns the requested data to the client.  Both of these processes create 
  12369. windows. 
  12370.  
  12371. In order to communicate a request to the server, the client must  first 
  12372. allocate a shared memory object, using the  DosAllocSharedMem() function as 
  12373. described in The Flat Memory Model.  Since the process  ID of the server 
  12374. process is known to the client, the client can provide  access to the shared 
  12375. memory object for the server process, using the  DosGiveSharedMem() function, 
  12376. which is also described in The Flat Memory Model.  This technique  is shown in 
  12377. Figure "Interprocess Communication Using Shared Memory (Part 1)". 
  12378.  
  12379. If the technique described in Creating Another Process is followed, and the 
  12380. server process has posted a message to the client at the completion of  server 
  12381. initialization, containing the window handle of the server's  object window, 
  12382. the client can dispatch the request as an  application-defined Presentation 
  12383. Manager message to the server's object window, with  a pointer to the memory 
  12384. object as a message parameter.  The server process then obtains access to the 
  12385. object using the DosGetSharedMem() function, as shown in Figure "Interprocess 
  12386. Communication Using Shared Memory (Part 2)". 
  12387.  
  12388. In the simplest case where the client process has only one window,  the handle 
  12389. of this window is passed to the server process when it is  created, as part of 
  12390. the DosExecPgm() call, as shown in Figure "Starting a Child Process".  Hence 
  12391. the server has access to the client's  window handle and can pass the return 
  12392. data to the client.  In a more complex situation where the client process has 
  12393. several windows and where a request can come from any of these, the handle can 
  12394. be passed as part of the request structure, as shown in Figure "Interprocess 
  12395. Communication Using Shared Memory (Part 1)" and  Figure "Interprocess 
  12396. Communication Using Shared Memory (Part 2)". 
  12397.  
  12398. Another issue that arises when using shared memory to communicate  between 
  12399. processes is that of freeing the shared memory object.  When a  process issues 
  12400. a DosGiveSharedMem() or DosGetSharedMem() call, the operating system increments 
  12401. a usage counter for the shared memory object, and will not release the memory 
  12402. until all processes  using the object have issued a DosFreeMem() call. 
  12403.  
  12404. For the server process that receives access to the shared memory  object, the 
  12405. DosFreeMem() call is simply made whenever the server process has finished with 
  12406. the contents of the memory object.  For the client process that initially 
  12407. creates the memory object, the DosFreeMem() call can be made  at either of two 
  12408. points: 
  12409.  
  12410.  If the client process does not care whether the request is  correctly 
  12411.   received by the server process, the DosFreeMem()  call can be made 
  12412.   immediately after passing the message to the server,  as shown in Figure 
  12413.   "Interprocess Communication Using Shared Memory (Part 1)". 
  12414.  
  12415.  If the client wishes to guarantee delivery of the request, it must pass the 
  12416.   message, wait for an acknowledgement of receipt from the server, and then 
  12417.   issue the DosFreeMem() call.  This  acknowledgement may simply be an 
  12418.   indication of receipt, prior to the  server processing the request, or may be 
  12419.   the returned data from the  request. 
  12420.  
  12421. Note that it is common for returned data from a request to be passed  using the 
  12422. same memory object as was used to contain the original  request.  In such 
  12423. cases, the memory object cannot be freed by the  client process until the 
  12424. returned data is received and processed. 
  12425.  
  12426.  
  12427. ΓòÉΓòÉΓòÉ 20.6.3. Atoms ΓòÉΓòÉΓòÉ
  12428.  
  12429. This example assumes that the two processes described in the  previous example 
  12430. require only to pass character strings, perhaps  containing the request and the 
  12431. returned information.  In this case, the  requester obtains the handle to the 
  12432. system atom table using the WinQuerySystemAtomTable() function. It may then add 
  12433. the request string to this table using the  WinAddAtom() function, and obtain 
  12434. an atom that represents the string in the table.  This atom  may then be passed 
  12435. to the server process in an application-defined  Presentation Manager message. 
  12436. An example of this technique is shown in Figure "Interprocess Communication 
  12437. Using Atoms (Part 1)". 
  12438.  
  12439. When the server process receives this message, it may also obtain the handle to 
  12440. the system atom table, and retrieve the string using the atom supplied in the 
  12441. message.  If the string is of a predefined length, the server may simply 
  12442. retrieve the string using the WinQueryAtomName() function. If the string is of 
  12443. variable length, the server may need to obtain the length of the string using 
  12444. the WinQueryAtomLength() function, and allocate a buffer for the string.  This 
  12445. is illustrated in Figure "Interprocess Communication Using Atoms (Part 2)". 
  12446.  
  12447. The server may return information to the requester using the system  atom 
  12448. table.  The WinAddAtom() function is used by the server  to add the result 
  12449. string to the atom table, and the  WinQueryAtomLength() and WinQueryAtomName() 
  12450. functions are used by the requester to retrieve the string.  In the  example 
  12451. shown in Figure "Interprocess Communication Using Atoms (Part 1)", it is 
  12452. assumed that the reply  string returned to the requester is of a predefined 
  12453. length, and the  WinQueryAtomLength() function is thus not required. 
  12454.  
  12455. Note that the request string is not removed from the atom table  until the 
  12456. server process has returned the result to the requester.  Once the result is 
  12457. obtained and verified, the requester removes both  the request and the result 
  12458. using the WinDeleteAtom()  function. 
  12459.  
  12460. The functions used to manipulate atoms and atom tables are described  in detail 
  12461. in the IBM OS/2 Version 2.0 Presentation Manager Reference. 
  12462.  
  12463.  
  12464. ΓòÉΓòÉΓòÉ 20.6.4. Queues ΓòÉΓòÉΓòÉ
  12465.  
  12466. A queue can be used to pass information between the process that created it and 
  12467. other processes in the system.  The process that creates the queue is known as 
  12468. the owner of the queue, and is the only process that can read  and remove 
  12469. elements from the queue.  Other processes may only add  elements to the queue. 
  12470.  
  12471. In a client-server environment, a queue is typically created by the  server 
  12472. process.  If a requester wishes to receive returned data from  the server 
  12473. process, it must therefore create its own queue.  Figure "Interprocess 
  12474. Communication Using Queues (Part 1)" shows a requester process using the 
  12475. DosCreateQueue() function to create its own queue, as well as using a queue 
  12476. owned by a server process. 
  12477.  
  12478. Queues may be created with a number of different ordering mechanisms.  The 
  12479. order of elements in a queue is determined when the queue is  created, and may 
  12480. be specified as FIFO, LIFO, or priority-based.  When  adding an element to a 
  12481. priority-based queue, a process must specify a  priority (from 0 to 15 with 0 
  12482. being lowest and 15 being highest) for  the element. 
  12483.  
  12484. Processes other than a queue's owner may gain write access to the  queue using 
  12485. the DosOpenQueue() function to obtain a queue handle.  Once this handle is 
  12486. obtained, the process  may use the DosWriteQueue() function to add elements to 
  12487. the queue.  The example in Figure "Interprocess Communication Using Queues 
  12488. (Part 1)" shows  a requester process that passes a request to a server process 
  12489. using a  queue created by that server process. 
  12490.  
  12491. The requester process first creates its own queue for returned data,  using the 
  12492. DosCreateQueue() function.  This queue will be  accessed by the server to write 
  12493. the returned data from the completed  request, which can then be read by the 
  12494. requester.  The example shown in Figure "Interprocess Communication Using 
  12495. Queues (Part 2)" creates a FIFO queue with the name specified in the  string 
  12496. constant REQQUENAME, and specifies that the addresses of any  elements placed 
  12497. in the queue by 16-bit processes are to be  automatically converted to 32-bit 
  12498. addresses by the operating system.  This conversion, specified using the 
  12499. QUE_CONVERT_ADDRESS flag, is used by 32-bit queue owners to avoid the need for 
  12500. the queue owner to explicitly convert addresses. 
  12501.  
  12502. The requester obtains access to the server's queue using the DosOpenQueue() 
  12503. function, passing the queue name as a parameter.  This function returns both a 
  12504. queue handle and the process identifier of the server process that owns the 
  12505. queue. 
  12506.  
  12507. The requester must allocate a shared memory object to contain the  request; the 
  12508. actual queue element contains only a pointer to that  memory object. The 
  12509. requester then invokes the  DosGiveSharedMem() function to provide read-only 
  12510. access (by  specifying only the PAG_READ flag) to that object for the server 
  12511. process, using the process identifier returned by the DosOpenQueue() function. 
  12512.  
  12513. The requester adds its request as a element in the queue, using the 
  12514. DosWriteQueue() function.  Note that the second parameter to  the function is 
  12515. an unsigned long integer, which may be used to pass application-specific 
  12516. information.  The value specified in this  parameter is passed to the queue 
  12517. owner as the ulData field  of a REQUESTDATA structure, which is returned by the 
  12518. DosReadQueue() function.  In this example, the parameter is  used to pass the 
  12519. window handle of the requester's object window to the  server process, so that 
  12520. a notification message can be passed to the  requester when the request has 
  12521. been completed. 
  12522.  
  12523. Once the element has been written to the queue, the requester  immediately 
  12524. relinquishes access to the server's queue by issuing a  DosCloseQueue() 
  12525. function call.  The shared memory object allocated for the request buffer is 
  12526. then released by the requester using the DosFreeMem()  function. 
  12527.  
  12528. The server process is very similar in structure to the requester, in that it 
  12529. creates its own queue, then awaits and services requests.  The server process 
  12530. is illustrated in Figure "Interprocess Communication Using Queues (Part 2)". 
  12531.  
  12532. Note that the server process does not use an object window.  It simply accepts 
  12533. requests from its own queue, using the DCWW_WAIT flag  to suspend itself in the 
  12534. DosReadQueue() call until an  element becomes available in the queue.  Once a 
  12535. request is complete, the server places the returned data on the requester's 
  12536. queue, extracts the window handle of the requester from the REQUESTDATA 
  12537. structure  provided by the DosReadQueue() call, and posts a message to the 
  12538. requester indicating that the request is complete. This message is processed by 
  12539. the requester to retrieve the returned data from the queue. Continue on the 
  12540. next page of this chapter. 
  12541.  
  12542.  
  12543. ΓòÉΓòÉΓòÉ 20.6.5. Queues (continued) ΓòÉΓòÉΓòÉ
  12544.  
  12545. After adding the request to the server's queue, the requester is  notified by 
  12546. the server when the request has been serviced.  This is  done using a 
  12547. Presentation Manager message, since the requester's window handle is  passed to 
  12548. the server in the second parameter to the  DosWriteQueue() function.  The 
  12549. operating system imbeds this  value as the second doubleword of a REQUESTDATA 
  12550. structure which is  passed to the server by the DosReadQueue() function. 
  12551.  
  12552. Once notification is received from the server process, the requester  uses the 
  12553. DosReadQueue() function to retrieve the returned  data from its own queue, as 
  12554. shown in Figure "Interprocess Communication Using Queues (Part 3)". 
  12555.  
  12556. The DCWW_WAIT flag causes the DosReadQueue() function to  wait until an element 
  12557. is available in the queue before returning  control to the application.  If the 
  12558. process merely wishes to check  whether a queue element is available, the 
  12559. DCWW_NOWAIT flag may be  specified, in which case an event semaphore must be 
  12560. created and its  handle passed to the DosReadQueue() function.  This  semaphore 
  12561. is immediately set by the operating system, and is posted  when an element is 
  12562. added to the queue.  If the queue is shared between  processes (as in the 
  12563. examples given herein), the semaphore must be  shared, either by creating it as 
  12564. a named semaphore or by setting the  DC_SEM_SHARED flag in the 
  12565. DosCreateEventSem() call. 
  12566.  
  12567. It will be noted that the use of queues is very similar to that of  shared 
  12568. memory, except that the queue is used to pass a pointer to a  shared memory 
  12569. object, rather than a Presentation Manager message.  However, queues  have an 
  12570. advantage in that they may be FIFO, LIFO or priority-based,  without the need 
  12571. for the application to handle the querying and sorting  of elements. 
  12572.  
  12573.  
  12574. ΓòÉΓòÉΓòÉ 20.6.6. Pipes ΓòÉΓòÉΓòÉ
  12575.  
  12576. While a queue may only be read by its owner, a pipe may be used for either read 
  12577. access, write access or both.  Pipes  function in a similar way to files, and 
  12578. once created, are accessed  using the OS/2 file system programming functions 
  12579. such as the  DosRead() and DosWrite() functions. This means that pipes can be 
  12580. accessed by other applications in the  system that support file system 
  12581. operations, including applications  executing in virtual DOS machines.  In this 
  12582. way, interprocess communication can be  supported between an OS/2 application 
  12583. and a DOS or Windows application. 
  12584.  
  12585. Pipes may be either named or anonymous.  Communication via an  anonymous pipe 
  12586. requires that the read and write handles for the pipe  are known to both 
  12587. processes involved in the communication.  Since these  handles are not shared 
  12588. by default, another means of passing the  handles, such as Presentation Manager 
  12589. messages or shared memory, must be used.  For  this reason, anonymous pipes are 
  12590. typically less useful than named pipes  for interprocess communication, and are 
  12591. therefore used mainly for  "streaming" communication between threads in the 
  12592. same process. 
  12593.  
  12594. Named pipes are even more similar to files than anonymous pipes,  since they 
  12595. are initially accessed using predefined names rather than  requiring handles. 
  12596. Hence a process may easily obtain access to a named  pipe, provided it knows 
  12597. the name of the pipe.  Once the pipe has been  created or opened, the process 
  12598. uses a pipe handle, which is similar to  a file handle, to access the pipe via 
  12599. DosRead() and DosWrite() function calls. 
  12600.  
  12601. OS/2 V2.0 introduces a number of new functions for accessing named  pipes, 
  12602. which simplify programming in the client-server environment.  These are the 
  12603. DosCallNPipe() function and the DosTransactNPipe() function, both of which are 
  12604. explained in the following text. 
  12605.  
  12606. Note that while queues allow many processes to access and write to  the queue, 
  12607. a named pipe is typically a one-to-one connection; the  creator of the pipe may 
  12608. interact with only one other process at a time,  and that process must 
  12609. relinquish access to the pipe before another  process may gain access.  For 
  12610. this reason, pipes have some limitations  when used in a client-server 
  12611. environment with many requesters being  serviced by a single server, as will 
  12612. become evident from the following  examples. 
  12613.  
  12614. A named pipe is normally created by the server process, using the 
  12615. DosCreateNPipe() function. During creation of the pipe, the server specifies 
  12616. the type of access  that is allowed for the pipe.  The following types of 
  12617. access are valid: 
  12618.  
  12619.  Inbound access (client to server) 
  12620.  Outbound access (server to client) 
  12621.  Duplex (both). 
  12622.  
  12623. Since only one client process may have access to a named pipe at any  given 
  12624. time, the requester must wait for the named pipe to become  available, using 
  12625. the DosWaitNPipe() function. 
  12626.  
  12627. Figure "Interprocess Communication Using Named Pipes (Part 1)" shows a 
  12628. secondary thread routine in a requester  process, which is dispatched to make a 
  12629. request to a server process. 
  12630.  
  12631. In the example shown in Figure "Interprocess Communication Using Named Pipes 
  12632. (Part 1)", the requester dispatches  a secondary thread that waits 
  12633. synchronously for the named pipe to  become available.  This thread accepts a 
  12634. pointer to a data structure  that contains the request and reply buffers along 
  12635. with the window handle of the window that initiated the thread. This window 
  12636. handle is included so that a notification message can be posted to the window 
  12637. when the request is complete.  Since a separate thread is dispatched for each 
  12638. request, the thread terminates when the reply is returned by the server.  Hence 
  12639. no object window is necessary. 
  12640.  
  12641. When the pipe becomes available, the requester opens the pipe, writes the 
  12642. request, reads the reply and then closes the pipe.  These functions are all 
  12643. performed by a single call to the  DosCallNPipe() function. This function 
  12644. actually opens the pipe using a DosOpen() function call, and writes the request 
  12645. to the pipe using the DosWrite() function. The reply is read using the 
  12646. DosRead() function and the pipe is closed using the DosClose() function. Use of 
  12647. the DosCallNPipe() function simplifies the  application code by allowing the 
  12648. programmer to combine these operations into a single function call. 
  12649.  
  12650. Once the reply is received from the server and the  DosCallNPipe() function 
  12651. returns, the requester thread notifies the window from which the request was 
  12652. made, by posting a Presentation Manager message to it.  The pointer to the 
  12653. transaction data structure initially passed to the thread is returned with the 
  12654. message, enabling the window procedure to easily differentiate this request 
  12655. from any others that may currently be active. 
  12656.  
  12657. The server process creates the named pipe, as shown in Figure "Interprocess 
  12658. Communication Using Named Pipes (Part 2)", using the DosCreateNPipe() function. 
  12659.  
  12660. Once the pipe is created, the server process makes the pipe available  to a 
  12661. requester process by issuing a DosConnectNPipe() function call.  This enables 
  12662. any requester processes currently waiting for the pipe to contend for 
  12663. ownership.  The requester that claims ownership returns from its DosWaitNPipe() 
  12664. call, while other requesters continue to wait. 
  12665.  
  12666. The server then uses the DosRead() function to retrieve a request from the 
  12667. pipe.  Since blocking mode is selected in the DosCreateNPipe() call by 
  12668. specifying the NP_WAIT flag, the DosRead() call does not return until a request 
  12669. becomes available. 
  12670.  
  12671. Once the read operation completes, the server process services the  request and 
  12672. writes the returned data back to the pipe using the  DosWrite() function.  It 
  12673. then informs the requester that the  request has completed, using a 
  12674. Presentation Manager message, and obtaining the window  handle of the requester 
  12675. from the Request structure. 
  12676.  
  12677. Note that the server process cannot make the pipe available to other requesters 
  12678. by issuing a DosDisconnectNPipe() call, until the current requester has 
  12679. completed retrieval of the information from the pipe.  If this call is issued 
  12680. before the requester retrieves  its returned data, the requester's DosRead() 
  12681. call will  fail.  The server ensures that correct synchronization is maintained 
  12682. by  passing the completion message synchronously using the  WinSendMsg() 
  12683. function.  For this reason, and in order to  ensure that user responsiveness is 
  12684. maintained, it is recommended that  requesters interacting with named pipes 
  12685. should do so from within object windows created in secondary threads under the 
  12686. control of the  application's primary process. 
  12687.  
  12688. Once the pipe is made available once more, this cycle of operations continues 
  12689. for each request issued to the server.  The server process is suspended within 
  12690. the DosConnectNPipe() call until a request is issued by a requester process. 
  12691.  
  12692. Note that where a one-to-one relationship exists between the server and 
  12693. requester processes, the requester need not relinquish access to the named pipe 
  12694. between requests.  In such situations, the named pipe would be opened by the 
  12695. requester using the DosOpen() function directly, and accessed using the 
  12696. DosTransactNPipe() function. This function combines the DosWrite() and 
  12697. DosRead() functions.  When the secondary thread is terminated, it can 
  12698. relinquish access to the pipe using the  DosClose() function. 
  12699.  
  12700.  
  12701. ΓòÉΓòÉΓòÉ 20.7. Maintaining Synchronization ΓòÉΓòÉΓòÉ
  12702.  
  12703. It is the responsibility of the application to ensure the  appropriate level of 
  12704. synchronization between threads or process accessing resources.  Assuming the 
  12705. convention suggested in Threads Without Object Windows, it is only necessary to 
  12706. indicate when a secondary thread or process has completed processing a 
  12707. particular unit of work.  This may be achieved in a number of ways: 
  12708.  
  12709.  By having the secondary thread or process post a completion message  to the 
  12710.   calling window procedure before terminating 
  12711.  
  12712.  By using an event semaphore in conjunction with the Presentation Manager 
  12713.   timer facility 
  12714.  
  12715.  By using the DosWaitThread() function in the case of  threads 
  12716.  
  12717.  By using the DosWaitChild() function in the case of  processes. 
  12718.  
  12719. While it is possible, when using object windows in secondary threads or 
  12720. separate processes, to ensure synchronization by using the  WinSendMsg() call 
  12721. for synchronous processing of the target  window procedure, this method is not 
  12722. recommended since it  prevents the calling window procedure from processing 
  12723. additional user  input, and is thus potentially in violation of SAA CUA 
  12724. guidelines.  In addition, immediate invocation of a window procedure in this 
  12725. way may  disturb the natural sequence of message processing and compromise the 
  12726. user's intention. 
  12727.  
  12728.  
  12729. ΓòÉΓòÉΓòÉ 20.7.1. Presentation Manager Messages ΓòÉΓòÉΓòÉ
  12730.  
  12731. Since a process in OS/2 owns data resources, window handles are  available to 
  12732. any threads under the control of that process.  It is  therefore possible for a 
  12733. secondary thread to post a message to the  window procedure that invoked it, 
  12734. advising that the secondary thread  has completed its processing.  The window 
  12735. procedure may then process  the message and take appropriate action. 
  12736.  
  12737. This technique may be used by secondary threads that use object  windows and 
  12738. those which do not.  It requires only that the secondary  thread have 
  12739. addressability to the window handle of the window procedure  that invoked it. 
  12740. This handle may be obtained directly from Presentation Manager, but  it is 
  12741. recommended that the handle of the invoking window procedure is  passed to the 
  12742. secondary thread upon invocation.  This may be done in  one of two ways: 
  12743.  
  12744.  By including the handle in the CtrlData parameter of the WinCreateWindow() 
  12745.   call if the secondary thread is using an  object window.  This also requires 
  12746.   passing the handle as a parameter to  the _beginthread() call used to create 
  12747.   the secondary  thread's main processing routine. 
  12748.  
  12749.  By including the handle as a parameter to the  DosCreateThread() call if 
  12750.   using a secondary thread without  an object window. 
  12751.  
  12752. The second method described above is illustrated in  Figure "Synchronization 
  12753. Using Presentation Manager Messages". 
  12754.  
  12755. Where the two communicating windows are under the control of  different 
  12756. processes, the window handles must be explicitly communicated  from one to the 
  12757. other since by default, the window handle of a window  in one process is not 
  12758. available to a window in another process.  One  technique for achieving this 
  12759. communication involves passing the window  handle of the first window when the 
  12760. second process is created, and  having the second window return a message to 
  12761. the first window after  initialization, containing the window handle of the 
  12762. second window.  This technique allows both communication and synchronization 
  12763. between  windows.  An example is given in Creating Another Process. 
  12764.  
  12765.  
  12766. ΓòÉΓòÉΓòÉ 20.7.2. Timers and Semaphores ΓòÉΓòÉΓòÉ
  12767.  
  12768. Another method of achieving synchronization between threads or  processes 
  12769. involves the use of an event semaphore and the Presentation Manager timer 
  12770. facility. The timer facility may be used from within a window procedure to 
  12771. create and start a timer that periodically sends messages of class WM_TIMER to 
  12772. the window, at intervals specified by the window procedure when the timer is 
  12773. created. 
  12774.  
  12775. In this case, the WM_TIMER message is used by the window procedure in the 
  12776. primary thread or process, to periodically check the state of an event 
  12777. semaphore that indicates whether the secondary thread or process has completed 
  12778. its processing.  The secondary thread or process sets the event semaphore upon 
  12779. commencing its processing, and releases (posts) it upon completion.  The 
  12780. primary thread or process queries the state of the semaphore to determine when 
  12781. the secondary thread or process has completed its processing. 
  12782.  
  12783. Note that when using this technique for synchronization between  processes 
  12784. (rather than between threads within the same process), the  event semaphore 
  12785. must be created as a shared semaphore, either by giving  it a name or by 
  12786. specifying the DC_SEM_SHARED flag when invoking the  DosCreateEventSem() 
  12787. function. 
  12788.  
  12789. An example of a secondary thread using this technique is shown in Figure 
  12790. "Synchronization Using an Event Semaphore (Part 1)". 
  12791.  
  12792. Note that the event semaphore is created as a shared semaphore and named.  A 
  12793. named semaphore is recommended since, if the secondary thread routine is placed 
  12794. in a  dynamic link library for subsequent use by other applications, or the 
  12795. secondary thread executes in a separate process, the name of the  semaphore may 
  12796. be included in the documentation for that library,  enabling calling window 
  12797. procedures to access the semaphore using the  DosOpenEventSem() function (see 
  12798. Figure "Synchronization Using an Event Semaphore (Part 2)").  Using this 
  12799. technique promotes code reusability. 
  12800.  
  12801. Figure "Synchronization Using an Event Semaphore (Part 2)" shows a window 
  12802. procedure using the  WinStartTimer() function to start a timer, immediately 
  12803. after dispatching a secondary thread such  as the one shown in Figure 
  12804. "Synchronization Using an Event Semaphore (Part 1)".  This timer in this 
  12805. example  will cause a WM_TIMER message to be passed to the window every 0.5 
  12806. seconds (500 milliseconds). 
  12807.  
  12808. Since the primary thread or process must remain responsive to the  end user and 
  12809. thus cannot wait indefinitely for the semaphore to be  released, the 
  12810. Presentation Manager timer facility is used to generate periodic WM_TIMER 
  12811. messages to the invoking window procedure in the primary thread or process. 
  12812. Upon receipt of each WM_TIMER message, the window procedure checks the state of 
  12813. the semaphore, timing out immediately if  the semaphore has not yet been 
  12814. released by the secondary thread or  process.  This technique is illustrated in 
  12815. Figure "Synchronization Using an Event Semaphore (Part 2)". 
  12816.  
  12817. Note once again the use of a named shared semaphore, in order to  reduce the 
  12818. level of interdependence between the primary and secondary threads/processes, 
  12819. thus facilitating the inclusion of the secondary routine into a dynamic link 
  12820. library for subsequent use by other applications. 
  12821.  
  12822.  
  12823. ΓòÉΓòÉΓòÉ 20.7.3. DosWaitThread() Function ΓòÉΓòÉΓòÉ
  12824.  
  12825. Where a secondary thread must complete its processing and  terminate before the 
  12826. primary thread can continue, the primary  thread may use the DosWaitThread() 
  12827. function to determine whether the secondary thread has terminated.  This 
  12828. function is used in conjunction with the Presentation Manager timer facility, 
  12829. to periodically check whether the secondary thread has issued a  DosExit() 
  12830. function call.  An example of a secondary thread  using this technique is given 
  12831. in Figure "Synchronization Using the DosWaitThread() Function (Part 1)". 
  12832.  
  12833. When the secondary thread has been started, the window procedure in the primary 
  12834. thread stores the thread identifier in its instance data area (typically using 
  12835. window words), and uses the Presentation Manager timer facility to send 
  12836. periodic WM_TIMER messages to itself, as shown in Figure "Synchronization Using 
  12837. the DosWaitThread() Function (Part 2)". 
  12838.  
  12839. Whenever it receives a WM_TIMER message, the window procedure retrieves the 
  12840. thread identifier from its instance data area and uses the DosWaitThread() 
  12841. function to determine whether the thread has terminated.  If so, it performs 
  12842. the required processing.  If the thread has not yet terminated, it immediately 
  12843. returns control to Presentation Manager.  Note the use of the DosExit() 
  12844. function in  Figure "Synchronization Using the DosWaitThread() Function (Part 
  12845. 1)".  This assumes that the processing  performed by the routine does not use 
  12846. an object window, and does not  call C run-time library functions. As mentioned 
  12847. earlier in this  chapter, secondary threads without object windows are 
  12848. typically used to  perform a single, lengthy task, and terminate upon 
  12849. completion of this  task.  Since they are able to use the DosExit() function 
  12850. and  the completion of their task causes the termination of the thread, such 
  12851. threads are ideal candidates for use of the DosWaitThread()  function.  For 
  12852. situations where the progress of execution must be  indicated to the primary 
  12853. thread, an event semaphore is more suitable. 
  12854.  
  12855. As already mentioned, there is very little difference between the  use of the 
  12856. DosWaitThread() function and the use of an event  semaphore.  Both are used in 
  12857. conjunction with the Presentation Manager timer facility  and in fact, both use 
  12858. an event semaphore.  The  DosWaitThread() function avoids the need for the 
  12859. application  to explicitly open and check the semaphore, since the 
  12860. DosWaitThread() function performs these operations  transparently. However, 
  12861. while an event semaphore may be used to  indicate any significant event during 
  12862. execution of a secondary thread,  while the DosWaitThread() function can only 
  12863. signal  termination of the thread.  Hence the DosWaitThread()  function is 
  12864. slightly less flexible than the explicit use of an event  semaphore with the 
  12865. Presentation Manager timer facility. 
  12866.  
  12867.  
  12868. ΓòÉΓòÉΓòÉ 20.7.4. DosWaitChild() Function ΓòÉΓòÉΓòÉ
  12869.  
  12870. The DosWaitChild() function allows a thread within a process to wait upon the 
  12871. termination of an asynchronous child process, in a similar manner to the 
  12872. DosWaitThread() function.  The DosWaitChild()  function allows a thread to wait 
  12873. for the termination of a single child  process, or the termination of an entire 
  12874. process tree (that is, a  process and all of its descendants). 
  12875.  
  12876. Note that only the calling thread in the parent process is suspended during a 
  12877. DosWaitChild() call.  If the parent process has  other threads, they will 
  12878. continue to be dispatched. 
  12879.  
  12880. The DosWaitChild() function can also be used to check the  termination status 
  12881. of a child process that has already terminated,  provided that process was 
  12882. started with the EXEC_ASYNCRESULT flag  specified in the DosExecPgm() call. 
  12883. The use of this flag  causes OS/2 to store the result code from the child 
  12884. process, for future  reference by a DosWaitChild() call. 
  12885.  
  12886. An example of the DosWaitChild() function is given in Figure "DosWaitChild() 
  12887. Function". Specifying the DCWA_PROCESS flag in the first parameter of the 
  12888. DosWaitChild() call causes the calling thread to wait only  upon the specified 
  12889. process, and not upon its children (if any).  If a  thread is to wait upon the 
  12890. entire process tree, the DCWA_PROCESSTREE  flag must be specified. 
  12891.  
  12892. The DCWW_WAIT flag in the second parameter causes the calling thread  to wait 
  12893. until the specified process has terminated.  The DCWW_NOWAIT  flag would cause 
  12894. the DosWaitChild() call to return  immediately, without waiting for a child 
  12895. process to end.  The  DCWW_NOWAIT flag is typically used when checking the 
  12896. termination status  of a child process that has already ended. 
  12897.  
  12898.  
  12899. ΓòÉΓòÉΓòÉ 20.8. Preserving Data Integrity ΓòÉΓòÉΓòÉ
  12900.  
  12901. Since data resources are owned by a process, rather than by threads  within the 
  12902. process, multiple threads may have addressability to the same static data 
  12903. storage areas, and potential problems arise  with regard to serialization of 
  12904. data access and maintenance of data  integrity. Similarly when multiple 
  12905. processes have access to a shared  memory object, it is the responsibility of 
  12906. the application to ensure  the integrity of shared resources; neither OS/2 nor 
  12907. Presentation Manager provide any  automatic methods of avoiding such problems. 
  12908. However, mechanisms are  provided whereby the application developer may prevent 
  12909. problems from  occurring.  Some suggested techniques for private data are as 
  12910. follows: 
  12911.  
  12912.  1. For any data that is private to a thread, use local variables  defined 
  12913.     within the thread, or automatic storage assigned from the stack (because 
  12914.     each thread has its own stack memory object, this data is automatically 
  12915.     protected since no other thread has addressability to this area of memory). 
  12916.  
  12917.  2. For any data that is private a particular window (as distinct from  the 
  12918.     window class), create a memory object to store this data and place  a 
  12919.     pointer in the window words, as described in Instance Data and Window 
  12920.     Words. 
  12921.  
  12922.  3. Specific data areas may be used to  contain data that is passed between 
  12923.     threads or processes.  If this data is only accessed in response to 
  12924.     particular messages passed between the threads or processes, and if these 
  12925.     messages are only generated at predefined points in the application's 
  12926.     execution (such as on entry to and exit from a window procedure), it is 
  12927.     relatively simple for an application to control access to these data areas. 
  12928.  
  12929.     Static allocation of such data areas is permissible where the accessing 
  12930.     routines reside and execute solely under the control of a single 
  12931.     application.  However, where such routines are placed in a library and 
  12932.     accessed by multiple applications, the potential for data corruption 
  12933.     through application error increases significantly, and dynamic data 
  12934.     allocation prior to invoking a secondary thread or passing a request to 
  12935.     another process should be considered to ensure the integrity of data areas. 
  12936.  
  12937.  4. For any code that will be placed in a DLL, it is important that a separate 
  12938.     set of memory objects is created for the data of each process that will 
  12939.     access the DLL.  In order to ensure this, a DATA NONSHARED statement should 
  12940.     be specified in the module definition file (see Module Definition File). 
  12941.  
  12942. Note that the above techniques apply to data shared between threads  within a 
  12943. process; OS/2 provides a variety of mechanisms for dealing  with data and 
  12944. memory areas that are shared between processes.  These  techniques are 
  12945. described in the IBM OS/2 Version 2.0 Control Program Reference. 
  12946.  
  12947.  
  12948. ΓòÉΓòÉΓòÉ 20.9. Client-Server Applications ΓòÉΓòÉΓòÉ
  12949.  
  12950. In situations where an object window is created in a secondary  thread to 
  12951. manipulate a data object such as a database, or to handle  access to a remote 
  12952. device or system, it is often desirable to have a  single object window 
  12953. performing the requested actions, in response to  requests from multiple 
  12954. display windows.  This follows the basic  architecture of a client-server 
  12955. application, in accordance with the object-oriented rule of allowing access to 
  12956. a  data object only from a single application object, and  therefore implements 
  12957. the concept of encapsulation. 
  12958.  
  12959. For example, a user may use different display windows to access  different 
  12960. views of the same database.  However, for reasons of  efficiency and data 
  12961. integrity, the actual database access should be  coordinated by a single object 
  12962. window, preferably in a secondary thread  in case a database access request 
  12963. causes a lengthy search. 
  12964.  
  12965. The question then arises of how the handle of the object window may  be made 
  12966. available to multiple display windows.  A number of options are available: 
  12967.  
  12968.  The handle may be stored as a global variable.  This is not recommended 
  12969.   however, since global variables are open to inadvertent modification, and 
  12970.   their use imposes programming restrictions with respect to variable names. 
  12971.  
  12972.  Immediately after the object window is created, its handle may be passed to 
  12973.   all display windows that require communication with the object window. 
  12974.   However, if subsequent modification of the application introduces a new 
  12975.   display window, additional modifications would be required to the module that 
  12976.   created the object window.  This increases the interdependence between 
  12977.   application objects, and is therefore not recommended. 
  12978.  
  12979.  The handle of the object window may be stored in the window words  of the 
  12980.   application's main window.  The handle of this window is  available to all 
  12981.   windows in the application, by querying the  application's switch entry (as 
  12982.   shown in Identifying the Destination Window).  If the  window words of the 
  12983.   application's main window are used to store a  pointer to a data structure, 
  12984.   which in turn contains the handles of  object windows and other items of a 
  12985.   global nature, these items may be  retrieved by window procedures when 
  12986.   required. 
  12987.  
  12988. The final method described above is therefore the recommended  solution. Object 
  12989. windows that will perform "server" tasks on  behalf of a number of display 
  12990. window "clients" should be created  by the window procedure for the 
  12991. application's main window, immediately  upon creation of the main window, and 
  12992. the handles of the object windows  stored in a data structure accessed via the 
  12993. window words of the main  window. 
  12994.  
  12995.  
  12996. ΓòÉΓòÉΓòÉ 20.10. Summary ΓòÉΓòÉΓòÉ
  12997.  
  12998. OS/2 allows multiple threads of execution to be initiated within an 
  12999. application.  Each thread is regarded as a distinct unit by the  operating 
  13000. system, and is scheduled independently of other threads and  processes in the 
  13001. system.  Each application has a primary thread,  created when the application 
  13002. is started.  An application may optionally  create one or more additional 
  13003. threads, known as secondary threads. 
  13004.  
  13005. In certain circumstances, an application may also create additional processes 
  13006. to perform some portion of the application's processing.  The use of additional 
  13007. processes may be necessary where different portions  of the application's 
  13008. processing must be isolated from one another.  It  is also useful for 
  13009. applications that exploit the Workplace Shell since by  default, all Workplace 
  13010. Shell objects share the same process and are hence  unprotected from one 
  13011. another. The use of multiple processes has  performance implications due to 
  13012. additional system overhead and should  thus be implemented with care. 
  13013.  
  13014. Secondary threads and processes may contain object windows, which do  not 
  13015. appear on the display screen but act as addresses to which messages  may be 
  13016. sent in order to initiate application processing.  An object  window typically 
  13017. "owns" a data object such as a database or  controls access to an external 
  13018. entity such as a remote system.  Where  the processing in response to an 
  13019. application event requires access to  another data object, the use of object 
  13020. windows in a secondary thread is  recommended. 
  13021.  
  13022. Communication with an object window is performed in the normal way  using 
  13023. Presentation Manager messages.  With suitable programming  conventions, the 
  13024. handle of the object window may easily be made  available to the calling window 
  13025. in order for such messages to be posted. 
  13026.  
  13027. A single object window may receive messages from multiple windows,  and perform 
  13028. actions on its data object on behalf of those windows.  This approach allows 
  13029. easy coordination of requests for access to a data  object, enhancing data 
  13030. integrity and efficiency of access.  Applications that use this technique 
  13031. follow the basic client-server  architecture, within the boundaries of the 
  13032. Presentation Manager application model. 
  13033.  
  13034. Where the scope of a long-running event is restricted to a single  method 
  13035. within the current application object, a secondary thread or  process may be 
  13036. initiated without an object window.  In such cases, a  subroutine is initiated 
  13037. in the secondary thread, and the thread  terminates immediately upon exiting 
  13038. that subroutine. 
  13039.  
  13040. Presentation Manager provides a number of methods by which an application can 
  13041. synchronize access to data objects and determine whether a secondary thread or 
  13042. process has completed processing an event.  These methods involve the use of 
  13043. functions such as DosWaitThread() or  DosWaitChild(), Presentation Manager 
  13044. messages and/or event semaphores. 
  13045.  
  13046. The multitasking capabilities of OS/2 allow greater application responsiveness 
  13047. since lengthy application processing may be performed in  an asynchronous 
  13048. manner, leaving the application's primary thread free  to continue interaction 
  13049. with the end user.  This also facilitates  conformance with the Systems 
  13050. Application Architecture CUA guideline stipulating that an  application should 
  13051. complete the processing of an event and be ready to  handle further user input 
  13052. within 0.1 seconds. 
  13053.  
  13054.  
  13055. ΓòÉΓòÉΓòÉ 21. Systems Application Architecture CUA Considerations ΓòÉΓòÉΓòÉ
  13056.  
  13057. The Presentation Manager environment provides the application developer with a 
  13058. rich set of functions that enable tasks to be performed in a variety of ways. 
  13059. However, within the general Presentation Manager application model, there are a 
  13060. number of considerations which, if observed, enable the design and development 
  13061. of applications that comply more closely with the guidelines and emerging 
  13062. conventions of the Systems Application Architecture CUA component.  This 
  13063. chapter will discuss some of the considerations involved in designing  an 
  13064. object-oriented, CUA-conforming Presentation Manager application. 
  13065.  
  13066. The Presentation Manager programming interface enables the creation and 
  13067. manipulation of windows in a variety of ways by an application developer. 
  13068. However, there is considerable value in adopting a series of standard practices 
  13069. for developing Presentation Manager applications, from the viewpoint of 
  13070. consistency and ease of maintenance, and to enhance the degree of conformance 
  13071. to SAA CUA guidelines.  The following points provide some guidelines on the 
  13072. interpretation of CUA specifications, and outline some emerging trends in the 
  13073. development of applications that use the Presentation Manager user interface. 
  13074.  
  13075.  
  13076. ΓòÉΓòÉΓòÉ 21.1. Standard Windows ΓòÉΓòÉΓòÉ
  13077.  
  13078. Standard windows are used to display the contents of data objects. The contents 
  13079. of a data object may, in turn, be comprised of other objects.  For example, if 
  13080. the data object is a directory on a workstation's fixed disk, its contents are 
  13081. files, which are themselves objects.  Alternatively, a data object may contain 
  13082. information in the form of text or formatted data.  Note that  an object may be 
  13083. defined by the user during execution; for example, if  the user is editing a 
  13084. text file and selects a block of text to be  operated upon, then that block of 
  13085. text becomes the scope of the  following series of actions, and is thus defined 
  13086. as an object. 
  13087.  
  13088. By convention, the nature of a user's interaction with a standard window should 
  13089. be unformatted and modeless; a standard window is used to  display objects or 
  13090. their contents, from which the user selects an object upon which to perform one 
  13091. or more actions.  The exact sequence of actions performed by the user in the 
  13092. window should not be of concern  to the application.  If a modal or otherwise 
  13093. structured dialog with the  user is required, the application developer should 
  13094. implement this  dialog as a dialog box.  For this reason, it is recommended 
  13095. that the  use of control windows be confined wherever possible to dialog boxes 
  13096. only.  An allowable exception to this rule is the instance where a standard 
  13097. window displays a list of objects;  in this case, the client window may be 
  13098. created as a container window or listbox. 
  13099.  
  13100. This is relatively simple for normal listboxes; however, for a listbox with 
  13101. special display requirements and which is therefore created with the style 
  13102. LS_OWNERDRAW, the application must subclass the frame window in order to 
  13103. intercept and process the WM_DRAWITEM messages  which are sent to the listbox's 
  13104. owner (the frame) whenever a listbox item must be redrawn on the screen. 
  13105.  
  13106. A standard window should normally be both sizable and movable on the screen, 
  13107. allowing the user to configure the visual appearance of the desktop to suit the 
  13108. tasks being performed.  A standard window should therefore be created with the 
  13109. FCF_SIZEBORDER style attribute in order to generate a sizing border for the 
  13110. window.  Similarly, the user should be able to maximize and minimize the window 
  13111. in order to more clearly display information, unless the logical requirements 
  13112. of the application scenario dictate otherwise; the standard window should thus 
  13113. also be created with the FCF_MINMAX style attribute.  A window that is neither 
  13114. sizable nor able  to be minimized or maximized is by definition an optimized 
  13115. window, and should be implemented using a dialog box. 
  13116.  
  13117. A standard window should always possess a title bar, to indicate the nature of 
  13118. the window's contents, and to provide a "handle" for moving the window on the 
  13119. screen; the frame window should therefore be created with the FCF_TITLEBAR 
  13120. style attribute.  For  an application's main window, the text displayed in the 
  13121. title bar should be the same as that displayed in the OS/2 Window List entry 
  13122. for the application, and should follow the convention "Object Name - View". 
  13123.  
  13124. For child windows containing objects or their contents, the window title should 
  13125. be the same as the name or identifier of the item in the parent window that 
  13126. caused the child window to be created.  For instance, the selection of a 
  13127. "Customer List" entry in the main window of an "Address Book" application might 
  13128. cause the display of a child window containing a list of customers' names; the 
  13129. title of this window  would be "Customer List - Details View".  Since a 
  13130. standard window represents an  object or group of objects, the title should 
  13131. always be a noun rather  than a verb. 
  13132.  
  13133. A standard window is created using the WinCreateWindow() or 
  13134. WinCreateStdWindow() functions.  WinCreateWindow() creates the frame and client 
  13135. windows in separate steps, whereas WinCreateStdWindow() creates both in a 
  13136. single step. A standard window is typically created with the FCF_SIZEBORDER, 
  13137. FCF_SYSMENU, FCF_TITLEBAR, FCF_MINMAX and FCF_MENU style attributes specified 
  13138. for the frame window.  See Figure "Sample Application Main Routine (Part 2) - 
  13139. Window Creation" for an illustration of the use of these style attributes. 
  13140.  
  13141. If an icon and/or accelerator table will be associated with the window, the 
  13142. FCF_ICON and FCF_ACCELTABLE style attributes should be specified.  The icon and 
  13143. accelerator table definitions will then be loaded from the specified resource 
  13144. file when the window is created. 
  13145.  
  13146. If the application does not wish to explicitly size and position a frame window 
  13147. on the desktop, the FCF_SHELLPOSITION style attribute may be specified. 
  13148. Presentation Manager will then determine a default size and position for the 
  13149. window. 
  13150.  
  13151. As an alternative to specifying all of the above attributes, the FCF_STANDARD 
  13152. attribute may be specified.  This attribute is assumed if the 
  13153. WinCreateStdWindow() call or the WinCreateWindow() call for a frame window 
  13154. contains no control data. 
  13155.  
  13156.  
  13157. ΓòÉΓòÉΓòÉ 21.2. The Menu Bar ΓòÉΓòÉΓòÉ
  13158.  
  13159. The menu bar is a menu which, in conjunction with its associated pulldown 
  13160. menus, enables the user to select an action from a list of valid actions,  to 
  13161. be applied to a selected object or group of objects displayed in a  window. The 
  13162. following guidelines should be followed in the design and  layout of the menu 
  13163. bar, for the purpose of consistency and ergonomic behavior: 
  13164.  
  13165.  A menu bar is not required for fewer than six actions, unless these are 
  13166.   actions specifically defined by CUA. 
  13167.  
  13168.  The number of entries within an menu bar should be kept to a minimum; it is 
  13169.   better to have a "deep" pulldown menu with many choices than to have a 
  13170.   "broad" menu bar.  This reduces the number of options displayed to the user 
  13171.   at any one time. 
  13172.  
  13173.  A menu bar must have a pulldown menu associated with it. 
  13174.  
  13175.  A pulldown menu item always represents an action, and therefore should always 
  13176.   be a verb. 
  13177.  
  13178.  Where selection of a menu bar entry results in the display of a pulldown 
  13179.   menu, the menu bar entry should indicate the generic nature of the group of 
  13180.   actions contained in the pulldown menu.  If these actions pertain to a 
  13181.   particular object or object class, the name of the object or class may be 
  13182.   used as part of the menu bar entry.  In such a case, the menu bar entry may 
  13183.   be either a verb or a noun. 
  13184.  
  13185.  If multiple distinct groups of actions, pertaining to a single object or 
  13186.   class, are contained within the same pulldown menu, they should be separated 
  13187.   by a horizontal separator bar within the pulldown menu. 
  13188.  
  13189.  A pulldown menu item that when selected, results in the display of a dialog 
  13190.   box, should have its text succeeded in the pulldown menu by an ellipsis (...) 
  13191.   to indicate that the dialog continues. 
  13192.  
  13193. The SAA CUA guidelines stipulate that each standard window has a menu bar, 
  13194. which contains actions specific to the object represented by that window. 
  13195. However, certain actions may be inapplicable at certain points during 
  13196. application execution.  If an action is not necessarily applicable at all 
  13197. stages of processing or for all data objects displayed within a window, that 
  13198. action should remain in the menu bar or pulldown menu, but should be disabled 
  13199. (that is, made non-selectable) until the point at which the action is valid. 
  13200.  
  13201. Selection of a valid menu bar or pulldown menu item should result in the 
  13202. immediate performance of the action, or the display of a dialog box  to obtain 
  13203. necessary information before performance of the requested  action may take 
  13204. place.  Selection of an invalid menu bar or pulldown  menu item will result in 
  13205. a "beep" and the continued display of the  pulldown.  The menu bar and pulldown 
  13206. menus are discussed in the IBM Systems Application Architecture CUA Advanced 
  13207. Guide to User Interface Design and the IBM Systems Application Architecture CUA 
  13208. Advanced Interface Design Reference. 
  13209.  
  13210. Presentation Manager provides mechanisms to achieve the insertion/deletion and 
  13211. enabling/disabling of menu bar items, as explained in the following sections. 
  13212.  
  13213.  
  13214. ΓòÉΓòÉΓòÉ 21.2.1. Inserting/Deleting Menu Bar Items ΓòÉΓòÉΓòÉ
  13215.  
  13216. The insertion of an item is achieved by sending a message of class 
  13217. MM_INSERTITEM to the system menu (or to the menu bar or appropriate pulldown 
  13218. menu) using the WinSendDlgItemMsg() function.  The menu item information is 
  13219. placed into a data structure of type MENUITEM, as shown in Figure "Dynamically 
  13220. Inserting a Menu Bar Item". 
  13221.  
  13222. In the example shown above, an item is to be inserted into a standard "File" 
  13223. pulldown menu.  The menu item information is placed  into the data structure 
  13224. MenuItem, and the text to appear in  the pulldown menu is contained in the 
  13225. string variable szItemText. 
  13226.  
  13227. Note however, that the menu bar is a child of the frame window, and the 
  13228. pulldown menu is a child of the menu bar.  In order to successfully pass the 
  13229. message, the handle of the frame window must be obtained, and used to obtain 
  13230. the handle of the menu bar window.  This  handle is then used in the 
  13231. WinSendDlgItemMsg() call, along  with the window identifier MN_FILE, to send 
  13232. the MM_INSERTITEM message  to the pulldown menu.  The frame window handle is 
  13233. obtained using the  WinQueryWindow() function, and the QW_PARENT attribute 
  13234. causes the function to return the handle of the client's parent (that is, the 
  13235. frame window). 
  13236.  
  13237. Once the frame window's handle is obtained, the various attributes of the 
  13238. MenuItem structure are initialized.  An MM_INSERTITEM  message is then sent 
  13239. directly to the pulldown menu. 
  13240.  
  13241. Deletion of an item is accomplished in a similar fashion using a message of 
  13242. class MM_DELETEITEM.  Both message classes and the MENUITEM data structure are 
  13243. described in the IBM OS/2 Version 2.0 Presentation Manager Reference. 
  13244.  
  13245. Inserting/Deleting Separators 
  13246.  
  13247. Where more than one logical group of items is contained within a single 
  13248. pulldown menu, these groups should be divided by a separator, which is a 
  13249. horizontal bar appearing between the last item of one group and the first item 
  13250. of the next, in order to provide a visual indication of the group's distinct 
  13251. identities.  A separator may be defined within the resource script file (see 
  13252. Presentation Manager Resources) or may be inserted and deleted dynamically by 
  13253. the application. This dynamic insertion/deletion is carried out in a similar 
  13254. manner to that already described for "normal" pulldown menu items.  However, 
  13255. the afStyle field in the MENUITEM structure is specified as MIS_SEPARATOR, and 
  13256. the text of the item is set to NULL.  In such  cases, an item identifier is not 
  13257. required for the separator, although  it is recommended since an identifier 
  13258. must be specified in order to  delete the separator from the pulldown menu 
  13259. should this be necessary at  a later time. 
  13260.  
  13261. Deletion of a separator is achieved in exactly the same manner as that 
  13262. described for a normal pulldown menu item, using a message of class 
  13263. MM_DELETEITEM and specifying the identifier of the separator to be deleted. 
  13264.  
  13265. Inserting/Deleting Pulldown Menus 
  13266.  
  13267. The technique for dynamically inserting a pulldown menu or cascade pulldown 
  13268. into the menu bar is basically similar to that already described for inserting 
  13269. a menu bar or pulldown menu item. An example is given in Figure "Dynamically 
  13270. Inserting a Pulldown Menu". 
  13271.  
  13272. The difference lies in the fact that a pulldown menu or cascade pulldown 
  13273. requires a menu template to be reserved in memory in order to contain the items 
  13274. that will subsequently be inserted into the pulldown.  This template is created 
  13275. using the WinCreateMenu() function, which returns a handle to the menu 
  13276. template.  This handle is then used in the hwndSubmenu field of the MENUITEM 
  13277. structure. 
  13278.  
  13279.  
  13280. ΓòÉΓòÉΓòÉ 21.2.2. Enabling/Disabling Items ΓòÉΓòÉΓòÉ
  13281.  
  13282. Disabling an item is achieved using the WinEnableMenuItem() function. Figure 
  13283. "Disabling an Menu Bar/Pulldown Menu Item" shows how to disable the menu bar 
  13284. item MI_VIEW. 
  13285.  
  13286. Enabling an item is achieved with the same message class, but FALSE is 
  13287. specified as the last attribute in the WinEnableMenuItem() function call. 
  13288.  
  13289. Note that the WinEnableMenuItem() function is new in OS/2 Version 2.0; previous 
  13290. versions of OS/2 required use of the WinSendDlgItemMsg() function to send an 
  13291. MM_SETITEMATTR message to the menu. 
  13292.  
  13293.  
  13294. ΓòÉΓòÉΓòÉ 21.2.3. Indicating Selected Items ΓòÉΓòÉΓòÉ
  13295.  
  13296. A pulldown menu may be used to display a list of options from which one or more 
  13297. items may currently be selected; for example, a pulldown menu might provide a 
  13298. list of fonts to be used by a word-processing or desktop publishing 
  13299. application.  SAA CUA guidelines stipulate that in such a case, the currently 
  13300. selected item or items within the pulldown menu should be indicated by a check 
  13301. mark next to the item.  Presentation Manager provides support for this 
  13302. convention by allowing a check mark to be displayed within the pulldown menu. 
  13303. This is achieved using the WinCheckMenuItem() function; Figure "Placing a Check 
  13304. Mark on a Pulldown Menu Item" shows how to place a check mark next to  the item 
  13305. MI_OPTION1. 
  13306.  
  13307. Note that the WinCheckMenuItem() function is new in OS/2 Version 2.0;  previous 
  13308. versions of OS/2 required the use of a WinSendDlgItemMsg() function call to 
  13309. send an MM_SETITEMATTR message to the menu. 
  13310.  
  13311. If a checked item is selected for a second time, the check mark should be 
  13312. removed by the application.  This is achieved by sending the same message to 
  13313. the menu bar, with FALSE specified for the last attribute in the function call. 
  13314.  
  13315. Note that the use of a check mark in a pulldown menu provides an alternative to 
  13316. the use of radio buttons or check boxes in simple dialogs. See Use of Control 
  13317. Windows for further information.  When a pulldown menu with a check mark is 
  13318. used to display more than one set of  mutually exclusive items, each set should 
  13319. be separated by a horizontal  bar in the pulldown menu.  See Presentation 
  13320. Manager Resources. 
  13321.  
  13322.  
  13323. ΓòÉΓòÉΓòÉ 21.3. Action Windows ΓòÉΓòÉΓòÉ
  13324.  
  13325. Under the guidelines provided by CUA'91, a dialog box is known as an action 
  13326. window.  Since this chapter discusses CUA guidelines, this term will be used 
  13327. herein when referring to the provisions made by CUA.  The term "dialog box" 
  13328. will be used when referring to the implementation of these concepts under 
  13329. Presentation Manager. 
  13330.  
  13331. Action windows used by an application may be either modal or modeless, although 
  13332. modeless windows are preferred under CUA. Both types of action window are 
  13333. defined as optimized windows; that is, they are created at a predefined optimal 
  13334. size for their function, and may not be resized by the user.  However, the use 
  13335. of each type of action window is different, as explained below. 
  13336.  
  13337. A dialog box is typically created using the Dialog Box Editor application 
  13338. supplied as part of the IBM Developer's Toolkit for OS/2 2.0, and is defined in 
  13339. a dialog template which is stored in a .DLG file and referenced from  the 
  13340. application's resource script file.  Dialog templates are fully  described in 
  13341. the IBM OS/2 Version 2.0 Application Design Guide. 
  13342.  
  13343. It is recommended that wherever possible, action windows should be created with 
  13344. a title bar.  Since action windows typically appear as the result of a menu bar 
  13345. item being selected, the title bar should contain the name of the parent 
  13346. object, plus the same text as the menu bar item.  This provides the user with a 
  13347. visual indication of the action which led to the action window being displayed. 
  13348.  
  13349. As already mentioned, an action window should not be sizable by the user, 
  13350. although it may be movable.  Similarly, a modal action window should not 
  13351. include minimize or maximize icons, since the user must complete the 
  13352. interaction with the action window at its optimal size prior to continuing with 
  13353. execution.  In the case of a modeless action window, there is no point in 
  13354. providing a maximize icon since the window is created at an optimal size for 
  13355. the information it will contain. However, since a user may wish to suspend the 
  13356. dialog in order to interact with other windows, the user may wish to remove the 
  13357. action window from the desktop.  In such cases, a modeless action window should 
  13358. include a minimize icon. 
  13359.  
  13360.  
  13361. ΓòÉΓòÉΓòÉ 21.3.1. Modeless Action Windows ΓòÉΓòÉΓòÉ
  13362.  
  13363. A modeless action window is preferred in situations where the dialog with the 
  13364. user need not be completed before other user interaction with the application 
  13365. may occur.  For instance, in an application object that performs an 
  13366. administrative procedure, data entry would typically be performed by the use of 
  13367. control windows.  Since the control windows should remain displayed at all 
  13368. times, their parent window should not be  sizable.  By definition, the parent 
  13369. window is an optimized window, and  should therefore be created as a dialog 
  13370. box.  However, it may not be  mandatory for the user to complete the dialog 
  13371. before interacting with  other windows, and the dialog box should therefore be 
  13372. modeless. 
  13373.  
  13374. Since the WinDlgBox() function automatically creates and executes a modal 
  13375. dialog box, a modeless dialog box must be created in one of two alternative 
  13376. ways: 
  13377.  
  13378.  Using the standard WinCreateWindow() function, with the FCF_BORDER frame 
  13379.   creation flag set.  Control windows such as entry fields and buttons may then 
  13380.   be created as children of the dialog box window. 
  13381.  
  13382.  Using a WinLoadDlg() call to load the dialog template from a resource into 
  13383.   memory, and then using the WinShowWindow() or WinSetWindowPos() functions to 
  13384.   make the dialog box visible.  The dialog template should have the FCF_BORDER 
  13385.   attribute set.  Control windows within the dialog box are defined in the 
  13386.   dialog template. 
  13387.  
  13388. The latter method is recommended for reasons of simplicity, since the dialog 
  13389. box and its control windows may be defined and stored in a resource file (see 
  13390. Presentation Manager Resources), making the definition of  the dialog box 
  13391. easier for the application developer. 
  13392.  
  13393. The dialog box may be explicitly positioned on the screen, regardless of the 
  13394. method used.  With the former method using the WinCreateWindow() function, the 
  13395. dialog box is positioned at the time it is created.  With the latter method, 
  13396. the dialog box is positioned during its processing of the WM_INITDLG message. 
  13397.  
  13398. The FCF_BORDER attribute results in the dialog box being displayed with a thin 
  13399. blue line as the dialog border.  This is in accordance with  the SAA CUA 
  13400. guidelines for modeless action windows. 
  13401.  
  13402. Note that the two methods described above will result in different 
  13403. initialization messages being received.  When created with the 
  13404. WinCreateWindow() function, the dialog box is regarded as a "normal" window, 
  13405. and a WM_CREATE message is passed to it.  When created with the WinLoadDlg() 
  13406. function however, a WM_INITDLG  message is passed instead. The application 
  13407. developer must bear this in  mind when creating the dialog procedures for such 
  13408. dialog boxes. 
  13409.  
  13410.  
  13411. ΓòÉΓòÉΓòÉ 21.3.2. Modal Action Windows ΓòÉΓòÉΓòÉ
  13412.  
  13413. Modal action windows are used to carry out a dialog with the user in order to 
  13414. define or qualify the properties of a data object upon which the user is 
  13415. operating or wishes to operate.  It is important to differentiate the 
  13416. properties of a data object from its contents; for instance, the properties of 
  13417. a text file might be its name, parent directory, archive/hidden/read-only 
  13418. attributes etc, whereas its contents would be the text within the file.  Under 
  13419. Presentation Manager, manipulation of an object's contents is typically carried 
  13420. out in a standard window, whereas definition or alteration of attributes is 
  13421. done using a dialog box. 
  13422.  
  13423. Note that where the dialog with the user is limited to a simple decision, a 
  13424. Presentation Manager message box should be used in preference to a dialog box 
  13425. for the implementation of an action window, since the coding effort and 
  13426. processing overhead associated with a message box is much less than that 
  13427. associated with loading and processing a dialog box.  See Message Boxes for 
  13428. more information  on the use of message boxes. 
  13429.  
  13430. A modal dialog box is typically loaded and processed in a single step using the 
  13431. WinDlgBox() call.  The modal nature of the dialog box is indicated to the user 
  13432. by a double blue line as the border for the dialog box, rather than the 
  13433. standard window border.  The different border indicates that the dialog box is 
  13434. modal, and also indicates that it may not be sized by the user.  This border is 
  13435. specified in the dialog template using the FCF_DLGBORDER attribute. 
  13436.  
  13437. By default, a modal dialog box is application-modal;  that  is, the user must 
  13438. complete interaction with the dialog box before any  further interaction may 
  13439. take place with windows in the current application.  A dialog box may also be 
  13440. system-modal, in which case the user must complete interaction with the dialog 
  13441. box before interacting with any other window in the system.  A system-modal 
  13442. dialog box is created in the same way as an application-modal dialog box, but 
  13443. with  the additional attribute FS_SYSMODAL specified in the dialog template. 
  13444.  
  13445.  
  13446. ΓòÉΓòÉΓòÉ 21.3.3. Standard Dialogs ΓòÉΓòÉΓòÉ
  13447.  
  13448. OS/2 Version 2.0 provides standard dialog boxes for handling the selection of 
  13449. files and fonts.  These dialogs conform to SAA CUA guidelines, and are 
  13450. implemented within Presentation Manager.  Applications are therefore not 
  13451. required to explicitly design and code such dialog functions, nor to modify 
  13452. them should the CUA guidelines change in the future. 
  13453.  
  13454. The standard dialogs are displayed using two Presentation Manager functions new 
  13455. to OS/2 Version 2.0; these are the WinFileDlg() and WinFontDlg() functions. 
  13456.  
  13457. File Dialog 
  13458.  
  13459. The standard file dialog enables a user to specify a file to be opened or a 
  13460. file name under which current work is to be saved, including  the ability to 
  13461. switch directories and logical drives.  The file dialog  provides basic 
  13462. capabilities, and is designed in such a way that it may  be modified if 
  13463. additional function is required. 
  13464.  
  13465. The file dialog is displayed using the WinFileDlg() function.  The dialog may 
  13466. be displayed as either an "Open" dialog or a "Save as" dialog, depending upon 
  13467. the value of control flags specified in a FILEDLG structure passed as a 
  13468. parameter to the function call.  The WinFileDlg() function is shown in Figure 
  13469. "Standard Dialogs - WinFileDlg() Function". 
  13470.  
  13471. The appearance of the file dialog is controlled by the FDS_* style flags 
  13472. specified in the fl field in the FILEDLG structure.  The fields in this 
  13473. structure are: 
  13474.  
  13475. Field               Usage 
  13476.  
  13477. cbSize              Defines the size of the FILEDLG structure, and should be 
  13478.                     initialized using the sizeof() function. 
  13479.  
  13480. fl                  Style flags of the form FDS_*, which control the attributes 
  13481.                     of the dialog.  These flags are described in the IBM OS/2 
  13482.                     Version 2.0 Presentation Manager Reference. 
  13483.  
  13484. IUser               Used by applications to store their own state information 
  13485.                     if subclassing the dialog in order to modify its appearance 
  13486.                     or behavior. 
  13487.  
  13488. IReturn             Identifier of the button used to dismiss the dialog.  This 
  13489.                     is typically DID_OK or DID_CANCEL, unless the application 
  13490.                     has subclassed the dialog and added its own buttons. 
  13491.  
  13492. ISRC                System return code which indicates the reason for dialog 
  13493.                     failure, if a failure has occurred.  This field is used to 
  13494.                     assist in debugging. 
  13495.  
  13496. pszTitle            Dialog title text.  If set to NULL, the text will default 
  13497.                     to "Open"  or "Save As", depending upon the FDS_* flags 
  13498.                     selected. 
  13499.  
  13500. pszOKButton         Text used for the OK pushbutton on the dialog.  If set to 
  13501.                     NULL, the text defaults to "OK". 
  13502.  
  13503. pfnDlgProc          Pointer to custom dialog procedure, for custom dialogs with 
  13504.                     the FDS_CUSTOM style flag set. 
  13505.  
  13506. pszIType            String pointer to a string defining the initial Extended 
  13507.                     Attribute type filter to be applied to the file name field 
  13508.                     in the dialog. 
  13509.  
  13510. pszITypeList        Pointer to a table of string pointers.  Each points to a 
  13511.                     null terminated string defining an Extended Attribute type 
  13512.                     filter.  The filters are displayed in ascending order in 
  13513.                     the Type pull-down box. 
  13514.  
  13515. pszIDrive           Pointer to a string specifying the initial logical drive to 
  13516.                     be applied in the dialog. 
  13517.  
  13518. ppszIDriveList      Pointer to a table of string pointers.  Each points to a 
  13519.                     null terminated string defining a valid logical drive. 
  13520.  
  13521. hMod                If the FDS_CUSTOM style flag is set, this field defines the 
  13522.                     DLL module handle that contains the file dialog template to 
  13523.                     be used.  If set to NULL, the dialog template is loaded 
  13524.                     from the application's EXE file. 
  13525.  
  13526. szFullFile          On initialization, this field contains the initial fully 
  13527.                     qualified path and file name, and on completion of the 
  13528.                     dialog, contains the selected or user-specified fully 
  13529.                     qualified file name.  Upon invocation of the dialog, all 
  13530.                     drive and path data is stripped from the name, and moved to 
  13531.                     the appropriate fields in the dialog box. 
  13532.  
  13533. ppszFQFilename      Pointer to a table of pointers.  Each points to a null 
  13534.                     terminated string containing a fully qualified file name. 
  13535.                     This table is used by applications that require multiple 
  13536.                     files to be selected from within the file dialog (indicated 
  13537.                     by specifying FDS_MULTIPLESEL).  The storage is allocated 
  13538.                     by the file dialog procedure, and must be freed after 
  13539.                     dialog completion using the WinFileFreeFileList() function. 
  13540.  
  13541. IFQFCount           Number of file names selected in the file dialog, for 
  13542.                     dialogs with multiple selection enabled. 
  13543.  
  13544. idDlg               Window identifier of the dialog window.  If the FDS_CUSTOM 
  13545.                     style flag is set, this is also the resource identifier of 
  13546.                     the dialog template. 
  13547.  
  13548. x,y                 Position of the dialog, relative to its parent.  These 
  13549.                     fields are automatically updated by the dialog procedure 
  13550.                     when the dialog is moved by the user, so that if the same 
  13551.                     FILEDLG procedure is used on subsequent invocations, the 
  13552.                     dialog will appear in the same location.  The FDS_CENTER 
  13553.                     style flag overrides any settings specified. 
  13554.  
  13555. sEAType             Extended Attribute file type to be be assigned to the file. 
  13556.                     This field contains the returned value specified in the 
  13557.                     Type field in the dialog.  This field is valid only for a 
  13558.                     "Save As" dialog; the value -1 is returned for an "Open" 
  13559.                     dialog. 
  13560.  
  13561. For applications with specialized file handling requirements, the standard file 
  13562. dialog may be subclassed, allowing these requirements to be handled while 
  13563. retaining standard processing for the majority of events.  This subclassing is 
  13564. invoked by specifying the address of an application-defined dialog procedure in 
  13565. the pfnDlgProc field  in the FILEDLG structure, and by specifying the resource 
  13566. identifier of  an application-defined dialog template if controls are to be 
  13567. added or  removed from the dialog. 
  13568.  
  13569. Note that application-defined dialog procedures should invoke the 
  13570. WinFileDlgProc() function as their default case for message processing, to 
  13571. ensure that messages not explicitly processed by the application are passed to 
  13572. the standard file dialog procedure for correct default processing. 
  13573.  
  13574. Font Dialog 
  13575.  
  13576. The standard font dialog enables a user to specify a choice of font names, 
  13577. styles, and sizes from the range available within a given application.  The 
  13578. font dialog is intended to fit basic application needs, and is designed in such 
  13579. a way that additional function may be added by subclassing the dialog 
  13580. procedure. 
  13581.  
  13582. The font dialog is displayed using the WinFontDlg() function, specifying the 
  13583. owner window for the dialog box, and a FONTDLG control structure.  The use of 
  13584. the WinFontDlg() function is shown in Figure "WinFontDlg() Function - Sample 
  13585. Code". 
  13586.  
  13587. The appearance of the dialog is determined by the FNTS_* flags specified in the 
  13588. fl field of the FONTDLG structure, and by the other fields in this structure. 
  13589. The fields in the FONTDLG structure are: 
  13590.  
  13591. Field               Usage 
  13592.  
  13593. cbSize              Defines the size of the structure, and should be 
  13594.                     initialized using the sizeof() function. 
  13595.  
  13596. hpsScreen           If not NULL, this field specifies the screen presentation 
  13597.                     space, which the dialog procedure queries for available 
  13598.                     fonts. 
  13599.  
  13600. hpsPrinter          If not NULL, this field specifies the printer presentation 
  13601.                     space, which the dialog procedure queries for available 
  13602.                     fonts. 
  13603.  
  13604. pszTitle            Title text for the dialog box.  If set to NULL, the default 
  13605.                     text "Font" is used. 
  13606.  
  13607. pszPreview          Text to be displayed in the Preview field in the dialog 
  13608.                     box.  If set to NULL, the default text "abcdABCD" is used. 
  13609.  
  13610. pszPtSizeList       String containing a list of numeric point sizes, to be 
  13611.                     displayed in  the Point Size drop-down list in the dialog 
  13612.                     box.  Point sizes within the string must be separated by 
  13613.                     spaces.  If set to NULL, the defaults of 8, 10, 12, 14, 18, 
  13614.                     and 24 are used. 
  13615.  
  13616. pfnDlgProc          Pointer to custom dialog procedure, for dialogs with the 
  13617.                     FNTS_CUSTOM flag set. 
  13618.  
  13619. szFamilyname        Font family name to be used by an application to select a 
  13620.                     font.  If  set to NULL, the system default is used. 
  13621.  
  13622. fxPointSize         Vertical point size of the font. 
  13623.  
  13624. fl                  Flags which specify the characteristics of the dialog box; 
  13625.                     these may be any combination of FNTS_CENTERED, FNTS_CUSTOM, 
  13626.                     FNTS_HELPBUTTON, FNTS_MULTIFONTSELECTION, and 
  13627.                     FNTS_MODELESS.  Flags are  combined using the "or" 
  13628.                     operator. 
  13629.  
  13630. flFlags             Flags; specifying FNTF_VIEWPRINTERFONTS specifies whether 
  13631.                     printer fonts should be included if both hpsScreen and 
  13632.                     hpsPrinter are non-NULL.  FNTF_PRINTERFONTSELECTED is set 
  13633.                     upon return, if the user selects a printer font. 
  13634.  
  13635. flType              Specifies additional font attributes specified by the user, 
  13636.                     and may  be used as the options field in a QFSATTRS 
  13637.                     structure for the GpiQueryFaceString() function. 
  13638.  
  13639. flTypeMask          Specifies which flags in the flType field are required to 
  13640.                     change.  This is only relevant where selections may be for 
  13641.                     different  types and styles when multiple fonts are being 
  13642.                     selected. 
  13643.  
  13644. flStyle             Specifies any additional selections, and may be used for 
  13645.                     the selection indicators in a FATTRS structure supplied to 
  13646.                     the GpiCreateLogFont() function. 
  13647.  
  13648. flStyleMask         Specifies which flags in the flStyle field are required to 
  13649.                     change.  This is only relevant where selections may be for 
  13650.                     different  types and styles when multiple fonts are being 
  13651.                     selected. 
  13652.  
  13653. flCHSOptions        These are equivalent to the CHS_* option flags used by the 
  13654.                     GpiCharStringPos() and GpiCharStringPosAt() functions. 
  13655.  
  13656. flCHSMask           Similar to flStyleMask. 
  13657.  
  13658. clrFore             Foreground color for the font. 
  13659.  
  13660. clrBack             Background color for the font. 
  13661.  
  13662. lUser               May be used by applications to pass information if 
  13663.                     subclassing the font dialog. 
  13664.  
  13665. lReturn             Identifier of the button used to dismiss the dialog.  This 
  13666.                     is typically DID_OK or DID_CANCEL, unless the application 
  13667.                     has subclassed the dialog and added its own buttons. 
  13668.  
  13669. ISRC                System return code that indicates the reason for dialog 
  13670.                     failure, if a failure has occurred.  This field is used to 
  13671.                     assist in debugging. 
  13672.  
  13673. lEmHeight           Value that may be used within a FONTMETRICS structure by 
  13674.                     applications. 
  13675.  
  13676. IXHeight            As above. 
  13677.  
  13678. iExternalLeading    As above. 
  13679.  
  13680. fAttrs              Complete font attribute (FATTRS) structure for the selected 
  13681.                     font.  Only the codepage field may be modified by the 
  13682.                     application prior to invoking the dialog. 
  13683.  
  13684. sNominalPointSize   Nominal point size of selected font. 
  13685.  
  13686. usWeight            Character thickness (for example, normal or bold).  The 
  13687.                     returned value may be used in the weightclass field in the 
  13688.                     QFSATTRS structure for the GpiQueryFaceString() function. 
  13689.  
  13690. usWidth             Character width.  The returned value may be used in the 
  13691.                     widthclass field in the QFSATTRS structure for the 
  13692.                     GpiQueryFaceString() function. 
  13693.  
  13694. x,y                 Position of the dialog relative to its parent.  These 
  13695.                     fields are automatically updated by the dialog procedure 
  13696.                     when the dialog is moved by the user, so that if the same 
  13697.                     FONTDLG structure is used on subsequent invocations, the 
  13698.                     dialog will appear in the same location.  The FNTS_CENTERED 
  13699.                     style flag overrides any settings specified. 
  13700.  
  13701. idDlg               Window identifier of the dialog window.  If the FNTS_CUSTOM 
  13702.                     style flag is set, this is also the resource identifier of 
  13703.                     the dialog template. 
  13704.  
  13705. hmod                If the FNTS_CUSTOM style flag is set, this field defines 
  13706.                     the DLL module handle that contains the file dialog 
  13707.                     template to be used.  If set to NULL, the dialog template 
  13708.                     is loaded from the application's EXE file. 
  13709.  
  13710. Applications may customize the font dialog through subclassing, by specifying 
  13711. the FNTS_CUSTOM style flag, giving the resource identifier and module handle of 
  13712. the application's customized font dialog template,  and the address of an 
  13713. application-defined dialog procedure, in the FONTDLG structure.  The 
  13714. WinFontDlg() function then performs the subclassing operation on the 
  13715. application's behalf. 
  13716.  
  13717. Note that application-defined dialog procedures should invoke the 
  13718. WinFontDlgProc() function as their default case for message processing, to 
  13719. ensure that messages not explicitly processed by the application are passed to 
  13720. the standard font dialog procedure for correct default processing. 
  13721.  
  13722. An application that uses its own dialog template must include all of the 
  13723. standard controls within the dialog box, in addition  to its own customized 
  13724. controls.  Those controls, which are not  required, may be rendered invisible 
  13725. in order to provide the correct  appearance. 
  13726.  
  13727. Control window identifiers in the range 0x0000 to 0x0FFF are reserved for use 
  13728. by standard controls.  The application's own controls should therefore use 
  13729. window identifiers greater than 0x0FFF. 
  13730.  
  13731.  
  13732. ΓòÉΓòÉΓòÉ 21.3.4. Use of Control Windows ΓòÉΓòÉΓòÉ
  13733.  
  13734. A number of control window classes are provided by Presentation Manager.  Under 
  13735. CUA guidelines, these control windows should be displayed in standard windows, 
  13736. although their use is more typically in dialog boxes.  This is in accordance 
  13737. with the convention that windows display objects or the contents of objects, 
  13738. and other more structured information such as object attributes is displayed in 
  13739. a dialog box.  See also the proviso regarding listboxes under Standard Windows. 
  13740. The use of control windows is defined in the IBM Systems Application 
  13741. Architecture CUA Advanced Guide to User Interface Design. However, there are 
  13742. some emerging conventions as to the exact interpretation of the CUA 
  13743. guidelines, and these are discussed in the following sections. 
  13744.  
  13745. Entry Field 
  13746.  
  13747. Entry fields are used where textual or numeric data is required from the user, 
  13748. and where the set of possible entries is open-ended.  Examples of such data 
  13749. items include file names, object descriptions etc. 
  13750.  
  13751. List Box 
  13752.  
  13753. A listbox is used to display a list of objects, where the contents of that list 
  13754. may change from one execution to the next, based upon various external or 
  13755. user-specified criteria.  One or more items may be selected from a listbox. The 
  13756. listbox is typically created with a size sufficient to display a certain number 
  13757. of items, and a scroll bar is provided if the number of items increases such 
  13758. that not all items may be displayed at once. 
  13759.  
  13760. Note that a listbox should not be used to display a set of choices where that 
  13761. set is finite and unchanging.  In such a case, radio buttons  may be used where 
  13762. the choices are mutually exclusive, or check boxes  used where more than one 
  13763. choice may be made concurrently. 
  13764.  
  13765. Combo Box 
  13766.  
  13767. A combo box, also known as a prompted entry field is a combination of the 
  13768. entry field and listbox control window styles, and is supported by 
  13769. Presentation Manager in OS/2 Version 1.2 and above.  A combo box is used where 
  13770. textual or numeric data is required from a user, where the set of possible 
  13771. entries is finite, and where the application wishes to prompt the user for a 
  13772. valid entry.  A combo box may be of three distinct types: 
  13773.  
  13774.  A simple combo box is displayed as an entry field with a  listbox directly 
  13775.   below it.  The user may enter textual or numeric data  into the entry field 
  13776.   in the same way as for a normal entry field, or  may select an item from the 
  13777.   listbox.  The selected item will then appear in the entry field.  The simple 
  13778.   combo box provides a similar function to that of a single-selection listbox. 
  13779.  
  13780.  A drop-down combo box is displayed as an entry field with an icon to its 
  13781.   immediate right.  The user may enter textual or numeric data into the entry 
  13782.   field, or may select the icon.  When selected, the icon causes a listbox to 
  13783.   appear below the entry field, containing a list of valid entries for the 
  13784.   entry field.  When selected,  an item appears in the listbox.  The drop-down 
  13785.   combo box is recommended where the set of valid entries is finite and 
  13786.   limited, but where the user may already know the required entry and may wish 
  13787.   to save time by entering it him/herself. 
  13788.  
  13789.  A drop-down list combo box is displayed in a similar manner to a drop-down 
  13790.   combo box, as an entry field with an icon to its immediate right.  However, 
  13791.   the user may not enter data directly into the entry field, but must select an 
  13792.   item from the listbox.  A drop-down list combo box is recommended in 
  13793.   situations where a number of control windows are located in a dialog box, 
  13794.   where the optimization of space is of primary importance, and where the 
  13795.   default entry is likely to be used. 
  13796.  
  13797. The use of a combo box is typically recommended in place of a listbox in order 
  13798. to save room within a dialog box, or in place of an entry field where the 
  13799. application wishes to prompt a user with a list of valid entries. 
  13800.  
  13801. Radio Button 
  13802.  
  13803. Radio buttons are used to indicate a group of mutually exclusive options;  that 
  13804. is, only one of the items in the group is selectable at any one time, and 
  13805. selecting one item automatically deselects any previously selected item. 
  13806. Selecting a radio button does not complete the dialog; a user may revise 
  13807. his/her selection any number of times during the dialog.  Once a final decision 
  13808. is made, the user completes the dialog using a push button (see below). 
  13809.  
  13810. Radio buttons are always displayed in groups; it makes no sense to have a 
  13811. single mutually exclusive selection item.  Text is displayed along with the 
  13812. buttons to indicate the choice represented by each button.  If multiple groups 
  13813. of radio buttons are present within a dialog box or window, or if radio buttons 
  13814. are combined with other types  of control window, it is recommended for reasons 
  13815. of clarity that the  radio buttons be placed within a group box, and that this 
  13816. group box be  named to indicate the nature or purpose of the group as a whole. 
  13817.  
  13818. As described above, radio buttons should be used to denote a set of mutually 
  13819. exclusive options in the creation or manipulation of an object, as part of a 
  13820. more complex dialog.  They should not be used to present a set of options in 
  13821. response to an application or system event,  where this set of options is the 
  13822. sole purpose of the dialog.  In such  cases, a message box is the preferred 
  13823. mechanism to achieve this type of communication with the user, since the 
  13824. processing overhead associated  with a message box is less than that associated 
  13825. with a dialog box.  For example, a warning that the user is about to exit the 
  13826. application  without saving his/her latest set of changes would be presented 
  13827. using a  message box rather than a dialog box with radio buttons. 
  13828.  
  13829. The equivalent function of a group of radio buttons may also be provided by a 
  13830. pulldown menu displaying a set of options, only one of which may be selected at 
  13831. any one time, with the selected item indicated by a check mark.  The use of  a 
  13832. pulldown menu is the recommended option in situations where the selection of an 
  13833. option is the only action to be performed.  The use of radio buttons is 
  13834. recommended where the selection of an option indicated  by the radio buttons is 
  13835. part of a more complex dialog. 
  13836.  
  13837. Note that from a programming viewpoint, "auto" radio buttons should be used in 
  13838. preference to standard radio buttons since these buttons are drawn and 
  13839. maintained by Presentation Manager.  The application need not concern itself 
  13840. with redrawing the buttons when their state changes, thereby allowing simpler 
  13841. programming. 
  13842.  
  13843. Check Box 
  13844.  
  13845. A check box is used to indicate a single option that may be toggled on or off 
  13846. by the user.  Multiple check boxes may appear in a single dialog box or window, 
  13847. and may refer to different attributes of the same object.  However, these 
  13848. attributes are related to each other only by their application to that same 
  13849. object, and should not be mutually exclusive. 
  13850.  
  13851. A 3-state button is a special type of check box that, in addition to being 
  13852. marked selected or non-selected, may be "grayed out" to indicate that a choice 
  13853. is non-selectable in the current dialog.  A 3-state button should be used 
  13854. whenever a dialog box is applicable to a range of objects, but where certain 
  13855. options within the dialog box are not valid for all objects dealt with by that 
  13856. dialog box.  A 3-state button may be enabled or disabled using the 
  13857. WinEnableWindow() function, obtaining the window handle of the button from a 
  13858. WinWindowFromID() call. 
  13859.  
  13860. The equivalent function to a check box may be provided by a pulldown  menu 
  13861. displaying a list of options, from which multiple items may be selected  at any 
  13862. one time, with the selected items indicated by check marks.  The  use of a 
  13863. pulldown menu is recommended where the selection of such an  option is the only 
  13864. action to be performed.  The use of a check box or  3-state button is the 
  13865. preferred solution where the selection is part of  a more complex dialog. 
  13866.  
  13867. Note that the "auto" versions of check boxes and 3-state buttons should be used 
  13868. in preference to the standard versions, since the auto versions are maintained 
  13869. by Presentation Manager, and the application need not concern itself with 
  13870. redrawing these buttons when their state changes. 
  13871.  
  13872. Push Button 
  13873.  
  13874. Push buttons are used to initiate an immediate action by the application.  If 
  13875. desired, push buttons can be used in conjunction with the menu bar and context 
  13876. menu, to provide easy access to commonly used functions in both primary windows 
  13877. and action windows. 
  13878.  
  13879. Push buttons should not be used to form menus of selectable options that cause 
  13880. child windows to appear when a push button is selected.  Such a practice 
  13881. effectively forms a hierarchical user interface, which is in violation of 
  13882. object-oriented user interface principles. 
  13883.  
  13884. An exception to this rule is a "Help" push button, which immediately displays a 
  13885. window containing help information, while maintaining the previous window or 
  13886. dialog on the screen.  Dismissing the help window returns the user to the 
  13887. original window in which the "Help" push button was displayed. 
  13888.  
  13889. Slider 
  13890.  
  13891. The slider is used where a single value must be selected from a continuous 
  13892. range of options.  For example, the brightness of the screen, the saturation of 
  13893. a color or the speed of the mouse cursor on the screen are all values selected 
  13894. from a continuous, though finite, range of options. 
  13895.  
  13896. Under previous versions of OS/2, scroll bars were often used to provide a 
  13897. portion of the slider's functionality.  The provision of the slider control 
  13898. under OS/2 Version 2.0 allows the scroll bar to be used only for its intended 
  13899. purpose of scrolling information within a window; this improves the consistency 
  13900. of the user interface and removes a potential source of user confusion. 
  13901.  
  13902. Value Set 
  13903.  
  13904. The value set control is used in a similar way to a set of radio buttons, to 
  13905. indicate a group of mutually exclusive options.  Many of the comments made for 
  13906. radio buttons apply equally to value sets. 
  13907.  
  13908. However, while the use of radio buttons is effectively limited to text items, a 
  13909. value set allows the use of text or graphical items, as well as color patches. 
  13910. Thus a value set provides additional flexibility where a selection must be made 
  13911. from a set of mutually exclusive options, providing a mechanism for the display 
  13912. of those options to the user, and allowing the user to directly select the 
  13913. required choice. 
  13914.  
  13915.  
  13916. ΓòÉΓòÉΓòÉ 21.3.5. Message Boxes ΓòÉΓòÉΓòÉ
  13917.  
  13918. By convention, message boxes are used to inform the user of an event, and to 
  13919. carry out a dialog with the user in the following circumstances: 
  13920.  
  13921.  Where the information to be conveyed to the user is simple and limited to no 
  13922.   more than a few lines of text 
  13923.  
  13924.  Where the input to be gained from the user is limited to a single decision 
  13925.   from a limited list of mutually exclusive options. 
  13926.  
  13927. The type of decision available to the user from a message box is also limited 
  13928. to simple choices such as "Yes/No", "OK/Cancel", or "Yes/No/Help".  Since the 
  13929. buttons displayed in the message box are  push buttons, selecting any button 
  13930. will result in the removal of the  message box from the screen and immediate 
  13931. action on the part of the  application.  An exception to this rule is the 
  13932. "Help" button, which should result in the message box being left on the screen, 
  13933. and the simultaneous display of a window containing help information.  This 
  13934. help window should be a child of the message box, so that it is dismissed when 
  13935. the message box is closed, and the input focus should return to the message box 
  13936. when the help window is dismissed. 
  13937.  
  13938. A message box is created and processed using the WinMessageBox() function as 
  13939. follows: 
  13940.  
  13941. rc = WinMessageBox(hDesktop,                 /* Desktop is parent     */
  13942.                    hwnd,                     /* Curr. window is owner */
  13943.                    szMessageText,            /* Message text          */
  13944.                    "Warning",                /* Title of message box  */
  13945.                    0,                        /* No message box ident. */
  13946.                    MB_YESNO |                /* Yes/No choices        */
  13947.                    MB_DEFBUTTON1 |           /* Yes is default choice */
  13948.                    MB_CUAWARNING);           /* Warning style         */
  13949.  
  13950. Message boxes may be of three types: 
  13951.  
  13952.  Notification message boxes inform the user of a system event that requires 
  13953.   his/her attention, but does not signify an error or potential error 
  13954.   condition.  Such message boxes are created with the message style 
  13955.   MB_CUANOTIFICATION. 
  13956.  
  13957.  Warning message boxes inform the user of a potential error condition that may 
  13958.   affect the integrity of the application or its data; for example, the user 
  13959.   may try to exit the application without  saving the latest set of changes to 
  13960.   a data object.  Such message boxes  are created with the message style 
  13961.   MB_CUAWARNING. 
  13962.  
  13963.  Critical message boxes inform the user of an error condition that requires 
  13964.   his/her immediate attention; for example, a diskette may be unreadable.  Such 
  13965.   message boxes are created with the message style MB_CUACRITICAL. 
  13966.  
  13967. These message box styles may be combined with other style identifiers that 
  13968. determine the buttons to be displayed in the message box, the default action 
  13969. and the modality of the message box (that is, system- or application-modal). 
  13970. These identifiers are described, along with the WinMessageBox() function, in 
  13971. the IBM OS/2 Version 2.0 Presentation Manager Reference. 
  13972.  
  13973. A message box should always be created with a title; while Presentation Manager 
  13974. provides a default message title if a null title string is specified in  the 
  13975. WinMessageBox() function, the use of this feature is not  recommended.  A 
  13976. message box title should identify the object or action  from which the message 
  13977. originated; for example, a message originating  from a "Parts List" object 
  13978. would have the title "Parts  List", whereas a message occurring as a result of 
  13979. an incorrectly completed dialog during an "Open File" action would have a title 
  13980. of "Open File". 
  13981.  
  13982. A message box is created as an optimized window, and by default is neither 
  13983. moveable nor sizable.  However, the situation may arise where the message is 
  13984. related to some information displayed in a window, and the decision to be made 
  13985. by the user is dependent upon the nature and context of that information.  The 
  13986. user must therefore be able to view the information in order to make the 
  13987. decision required by the message box, and the information may be hidden by the 
  13988. message box itself.  To avoid this situation, a message box may be specified 
  13989. with the style identifier MB_MOVEABLE, which allows the message box to be moved 
  13990. (although not sized) by clicking the mouse on its title in a similar fashion to 
  13991. that used for a standard window. 
  13992.  
  13993.  
  13994. ΓòÉΓòÉΓòÉ 21.4. Maintaining User Responsiveness ΓòÉΓòÉΓòÉ
  13995.  
  13996. The particular implementation of the message handling concept under 
  13997. Presentation Manager means that it is possible for a user to be "locked out" of 
  13998. the system if a window procedure does not return from processing a message 
  13999. within a reasonable period of time, since Presentation Manager only dispatches 
  14000. messages from the system queue to other applications when the currently active 
  14001. application attempts to retrieve  a message from its queue. 
  14002.  
  14003. The "reasonable" period of time is defined under Presentation Manager 
  14004. guidelines to be 0.1 seconds; a window procedure should complete the processing 
  14005. of a message within this period and return control to the application's main 
  14006. routine in order that the main routine may issue its next WinGetMsg() call. 
  14007. While this time period is adequate for processing of most messages, it may be 
  14008. insufficient for some messages; for examples, those that involve lengthy 
  14009. operations such as access to a remote system. 
  14010.  
  14011. In order to avoid the situation where an application or the entire Presentation 
  14012. Manager environment is unresponsive to the end user, OS/2 allows applications 
  14013. to create secondary threads of execution to handle lengthy  processing, thus 
  14014. enabling the application's primary thread to continue  responding to user 
  14015. interaction.  Presentation Manager also provides a number of methods by which 
  14016. synchronization between threads may be achieved in order to ensure the 
  14017. integrity of the user's intention and of data resources manipulated by the 
  14018. application.  The use of secondary threads, and techniques for synchronizing 
  14019. execution between threads and processes, are discussed in Multitasking 
  14020. Considerations. 
  14021.  
  14022.  
  14023. ΓòÉΓòÉΓòÉ 21.5. Summary ΓòÉΓòÉΓòÉ
  14024.  
  14025. It can be seen that there are emergent programming conventions governing the 
  14026. use of Presentation Manager and operating system constructs to implement 
  14027. CUA-conforming, object-oriented applications under the Presentation Manager 
  14028. application architecture.  These principles facilitate the achievement of the 
  14029. many benefits attributable to the use of an object-oriented design approach, 
  14030. while remaining within the framework of Systems Application Architecture. 
  14031.  
  14032. Guidelines have been established, in accordance with emerging conventions, with 
  14033. regard to the use of standard and control windows, dialog boxes and message 
  14034. boxes, and the nature of their interaction with the user.  Each type of window 
  14035. has its own particular role in the interaction between the application and the 
  14036. end user; adherence to these conventions will provide a greater level of 
  14037. consistency between applications, within the parameters of the CUA 
  14038. specifications. 
  14039.  
  14040. The CUA guidelines specify that an application should have a response time of 
  14041. no more than 0.1 seconds, after which time the application should be ready to 
  14042. process the next user interaction.  However, the situation may arise where a 
  14043. unit of processing takes longer than the allowed time period. A number of ways 
  14044. exist by which the application may overcome this problem, typically involving 
  14045. the use of asynchronous threads, either with or without object windows. 
  14046.  
  14047. The embodiment of these principles into Presentation Manager applications at 
  14048. the design stage results in closer conformance to Systems Application 
  14049. Architecture guidelines.  The enterprise may thereby achieve the benefits of a 
  14050. consistent and intuitive approach to the human-machine interface between users 
  14051. and applications. 
  14052.  
  14053.  
  14054. ΓòÉΓòÉΓòÉ 22. Application Migration ΓòÉΓòÉΓòÉ
  14055.  
  14056. OS/2 Version 2.0 provides application compatibility at the executable code 
  14057. level for applications written to run under previous versions of OS/2.  Hence 
  14058. no modification is necessary to enable such applications to run under Version 
  14059. 2.0. However, in order to take full advantage of the enhanced capabilities of 
  14060. OS/2 Version 2.0, such as the 32-bit flat memory model and the additional 
  14061. features implemented by Presentation Manager, applications will require 
  14062. modification of their source code. 
  14063.  
  14064. Application developers who wish to migrate their code to the 32-bit programming 
  14065. environment under OS/2 Version 2.0 should experience little difficulty. Changes 
  14066. between the OS/2 Version 2.0 programming environment and that provided under 
  14067. previous versions of OS/2 fall into the following basic categories: 
  14068.  
  14069.  Data types 
  14070.  
  14071.  Function name changes 
  14072.  
  14073.  Function enhancements 
  14074.  
  14075.  Memory management 
  14076.  
  14077.  New Presentation Manager functions. 
  14078.  
  14079. The remainder of this chapter will describe each of these categories in detail, 
  14080. and suggest methods by which the required changes may be made. 
  14081.  
  14082. Note that it is not mandatory for an application to migrate all its modules and 
  14083. resources to the 32-bit programming environment.  OS/2 Version 2.0 allows mixed 
  14084. model programming, where 32-bit applications may make use of existing 16-bit 
  14085. modules and resources.  The subject of mixed model programming is discussed in 
  14086. Mixing 16-Bit and 32-Bit Application Modules. 
  14087.  
  14088.  
  14089. ΓòÉΓòÉΓòÉ 22.1. Data Types ΓòÉΓòÉΓòÉ
  14090.  
  14091. A number of the function type declarations and data type definitions used by 
  14092. Presentation Manager map into different "standard" C language type definitions 
  14093. under OS/2 Version 2.0.  This is due to the differences between the 16-bit 
  14094. architecture of previous versions and the 32-bit architecture of Version 2.0. 
  14095.  
  14096. For example, the Presentation Manager data type EXPENTRY, used to declare 
  14097. exportable entry points, is defined under OS/2 Version 1.3 in the following 
  14098. way: 
  14099.  
  14100. #define EXPENTRY     pascal far
  14101.  
  14102. However, the pascal linkage convention is not used in the 32-bit OS/2 Version 
  14103. 2.0  programming environment, since all function calls use the standard C 
  14104. calling convention.  The only exception is when creating applications that 
  14105. access 16-bit functions; see Mixing 16-Bit and 32-Bit Application Modules. 
  14106.  
  14107. In addition, far memory references are not used, since the 32-bit flat memory 
  14108. model allows addressability to all locations in the process address space.  In 
  14109. the 32-bit programming environment therefore, the EXPENTRY type is defined as 
  14110. blanks; 32-bit applications are not required to use the EXPENTRY keyword. 
  14111.  
  14112. The OS/2 header file os2.h provided with the IBM Developer's Toolkit for OS/2 
  14113. 2.0 provides transparent remapping of the Presentation Manager type definitions 
  14114. to their new C language equivalents, and thus no modification is required to 
  14115. existing functions and data definitions that use the Presentation Manager 
  14116. types.  However, applications that have used standard C language type 
  14117. definitions in place of the Presentation Manager types will require 
  14118. modification.  For this reason, it is recommended that all Presentation Manager 
  14119. applications should use the Presentation Manager function and data type 
  14120. definitions. 
  14121.  
  14122.  
  14123. ΓòÉΓòÉΓòÉ 22.2. Function Name Changes ΓòÉΓòÉΓòÉ
  14124.  
  14125. Under OS/2 Version 2.0, certain function names for operating system kernel 
  14126. functions and Presentation Manager functions have been changed to provide 
  14127. improved consistency.  These changes obey the following rules: 
  14128.  
  14129.  The use of the terms Create, Get, Set and Query in function names is in 
  14130.   accordance with SAA conventions, as follows: 
  14131.  
  14132.    - Create implies that a new resource is created as the result of a function 
  14133.      call. 
  14134.  
  14135.    - Get implies that a resource is made available to the application as the 
  14136.      result of a function call. 
  14137.  
  14138.    - Set implies that a system value is changed as a result of a function call. 
  14139.  
  14140.    - Query implies that a system value or handle to an existing function is 
  14141.      returned as the result of a function call. 
  14142.  
  14143.  Verbs are placed before nouns in function calls. 
  14144.  
  14145.  Similar actions have similar semantics, although they may operate on 
  14146.   different types of resources. 
  14147.  
  14148. These changes have been made in order to provide improved consistency in 
  14149. function names, simplifying the task of learning the various function names. 
  14150.  
  14151. Applications that use operating system functions should be checked and function 
  14152. names altered where necessary.  A list of corresponding function names in OS/2 
  14153. Version 1.3 and OS/2 Version 2.0 is given in OS/2 Version 2.0 - Volume 1: 
  14154. Control Program. 
  14155.  
  14156.  
  14157. ΓòÉΓòÉΓòÉ 22.3. 32-Bit Interface Constraints ΓòÉΓòÉΓòÉ
  14158.  
  14159. The following subsystems, present in OS/2 Version 1.3, have no 32-bit 
  14160. equivalents, since they are not portable and are device-dependent. 
  14161.  
  14162. VIO         Video subsystem; these function calls should be replaced with 
  14163.             Presentation Manager GPI calls or AVIO (advanced video) calls. 
  14164.  
  14165. KBD         Keyboard subsystem; these function calls should be replaced by 
  14166.             processing WM_CHAR messages from a Presentation Manager 
  14167.             application. 
  14168.  
  14169. MOU         Mouse subsystem; these function calls should be replaced by 
  14170.             processing WM_MOUSEMOVE and WM_BUTTON messages. 
  14171.  
  14172. MON         Device monitor subsystem; these function calls should be replaced 
  14173.             by using appropriate message queue hooks in a Presentation Manager 
  14174.             application. 
  14175.  
  14176. Note that these subsystems are supported under OS/2 Version 2.0 as 16-bit 
  14177. service layers, for access by existing applications.  However, OS/2 Version 2.0 
  14178. does not provide thunk layers to enable 32-bit applications to access these 
  14179. service layers.  32-bit applications that use these subsystems must employ 
  14180. mixed model programming techniques to access the 16-bit services; see Mixing 
  14181. 16-Bit and 32-Bit Application Modules for further discussion. 
  14182.  
  14183. Only two forms of input/output are supported in the 32-bit environment; the 
  14184. stdin/stdout C interface (producing command line-based applications that can be 
  14185. run in a text window) and Presentation Manager applications.  Programs wishing 
  14186. to perform graphics, handle keyboard or mouse input, or intercept and modify 
  14187. device information should do so using Presentation Manager functions. 
  14188.  
  14189. Certain other functions have also been removed from the 32-bit programming 
  14190. interface.  These are primarily concerned with the management of memory in the 
  14191. segmented memory model.  Therefore functions such as DosSizeSeg(), DosLockSeg() 
  14192. and DosUnlockSeg(), DosR2StackRealloc() etc are not implemented in the 32-bit 
  14193. programming interface, although the 16-bit entry points are still supported for 
  14194. compatibility purposes. 
  14195.  
  14196.  
  14197. ΓòÉΓòÉΓòÉ 22.4. Function Enhancements ΓòÉΓòÉΓòÉ
  14198.  
  14199. A number of enhancements have been made to existing operating system functions 
  14200. in OS/2 Version 2.0.  These include the semaphore functions for synchronization 
  14201. between threads and processes, and the DosCreateThread() function for 
  14202. initiating secondary threads. 
  14203.  
  14204.  
  14205. ΓòÉΓòÉΓòÉ 22.4.1. Semaphore Functions ΓòÉΓòÉΓòÉ
  14206.  
  14207. The enhanced semaphore functions available under OS/2 Version 2.0 were 
  14208. described in Operating System/2.  Previous versions of OS/2 provided only basic 
  14209. semaphore facilities with limited capability to handle multiple events.  Where 
  14210. these semaphores were used in applications under previous versions of OS/2, 
  14211. they may be updated to the new OS/2 Version 2.0 semaphore facilities using the 
  14212. following guidelines: 
  14213.  
  14214.  Where a semaphore is used to serialize the access to a particular data object 
  14215.   or system resource from multiple threads, a mutex semaphore should be used. 
  14216.  
  14217.  Where a semaphore is used to signal an event occurring in one thread to other 
  14218.   threads having an interest in this event, an event semaphore should be used. 
  14219.  
  14220.  Where an application waits upon the clearing of one semaphore from a range of 
  14221.   semaphores using the DosMuxWaitSem() function, this function may be replaced 
  14222.   by the use of a muxwait semaphore. 
  14223.  
  14224.   The muxwait semaphore has additional flexibility over the use of the 
  14225.   DosMuxWaitSem() function with normal semaphores under previous versions of 
  14226.   OS/2, since with a muxwait semaphore, a thread may wait for any one of a list 
  14227.   of mutex semaphores or event semaphores to be cleared (as with previous 
  14228.   versions), or may wait for all of the semaphores to be cleared.  This latter 
  14229.   capability is not available under OS/2 Version 1.3. 
  14230.  
  14231. The enhanced semaphore functions available under OS/2 Version 2.0 are described 
  14232. in the IBM OS/2 Version 2.0 Control Program Reference. 
  14233.  
  14234.  
  14235. ΓòÉΓòÉΓòÉ 22.4.2. Thread Management ΓòÉΓòÉΓòÉ
  14236.  
  14237. The DosCreateThread() function has been enhanced in OS/2 Version 2.0 to 
  14238. facilitate the creation of secondary threads.  Under previous versions of OS/2, 
  14239. an application was required to explicitly allocate a memory segment for the 
  14240. stack to be used by a secondary thread.  Under OS/2 Version 2.0 however, stack 
  14241. allocation is performed as a built-in part of the DosCreateThread() function, 
  14242. and deallocation is performed automatically by the operating system upon 
  14243. termination of a thread. 
  14244.  
  14245. Applications that use the DosCreateThread() function should be modified to use 
  14246. the new form of the function call, as shown in Figure "DosCreateThread() 
  14247. Function". 
  14248.  
  14249. Note that the DosCreateThread() function under OS/2 Version 2.0 also allows 
  14250. parameters to be passed to the thread as part of the DosCreateThread() 
  14251. function.  The third parameter to the function is a 32-bit pointer, which may 
  14252. be used to pass the address of an application-defined data structure containing 
  14253. the required parameter data. 
  14254.  
  14255. The DosCreateThread() function and its implementation under OS/2 Version 2.0 
  14256. are described in greater detail in IBM OS/2 Version 2.0 Control Program 
  14257. Reference. 
  14258.  
  14259. OS/2 Version 2.0 also allows an application to forcibly terminate a thread 
  14260. using the DosKillThread() function. This function allows an application's 
  14261. primary thread to terminate any secondary threads prior to its own shutdown, in 
  14262. a more elegant manner than was possible under previous versions of OS/2. 
  14263.  
  14264.  
  14265. ΓòÉΓòÉΓòÉ 22.5. Memory Management ΓòÉΓòÉΓòÉ
  14266.  
  14267. The 64KB segment size limitation imposed by the Intel 80286 processor 
  14268. architecture has been eliminated in OS/2 Version 2.0, avoiding the need for 
  14269. applications to allocate large data structures in individual units of 64KB. The 
  14270. flat memory model implemented under OS/2 Version 2.0 allows applications to 
  14271. request the allocation of individual memory objects up to 512MB in size, using 
  14272. the DosAllocMem() function, an example of which is shown in Figure 
  14273. "DosAllocMem() Function". 
  14274.  
  14275. The above example shows the allocation of 73KB of memory as a single memory 
  14276. object, with read and write access permitted.  The PAG_COMMIT flag is set in 
  14277. the DosAllocMem() function call, in order to commit the storage immediately. 
  14278.  
  14279.  
  14280. ΓòÉΓòÉΓòÉ 22.6. New Presentation Manager Functions ΓòÉΓòÉΓòÉ
  14281.  
  14282. A number of new functions have been added to Presentation Manager under OS/2 
  14283. Version 2.0.  While these functions do not add new capabilities to the 
  14284. Presentation Manager interface, they simplify application development by 
  14285. combining operations that previously required multiple steps into a single 
  14286. Presentation Manager function call. 
  14287.  
  14288. Table "New Presentation Manager Functions in OS/2 Version 2.0" 
  14289.  
  14290. A number of other functions are also added in OS/2 Version 2.0, and are used to 
  14291. deal with the passing of messages between 16-bit and 32-bit modules in 
  14292. Presentation Manager applications.  These functions are discussed in Mixing 
  14293. 16-Bit and 32-Bit Application Modules. 
  14294.  
  14295. These functions are described in more detail in the IBM OS/2 Version 2.0 
  14296. Presentation Manager Reference. 
  14297.  
  14298.  
  14299. ΓòÉΓòÉΓòÉ 22.7. Summary ΓòÉΓòÉΓòÉ
  14300.  
  14301. Existing 16-bit applications written for OS/2 Version 1.3 may execute under 
  14302. OS/2 Version 2.0 without modification.  However, significant enhancements to 
  14303. performance and functionality are possible by taking advantage of additional 
  14304. features provided by the 32-bit OS/2 Version 2.0 environment.  In order to take 
  14305. full advantage of the 32-bit environment, applications must be modified to use 
  14306. the new features. 
  14307.  
  14308. In addition, a number of changes have been made in the 32-bit programming 
  14309. environment to provide improved consistency and ease of use, simplifying the 
  14310. task of learning the operating system interfaces and reducing the amount of 
  14311. coding required by application developers.  The incorporation of these changes 
  14312. into applications will also require source code modification. 
  14313.  
  14314. It is not necessary for applications to migrate all their modules and resources 
  14315. to the 32-bit environment, since OS/2 Version 2.0 allows mixing of 16-bit and 
  14316. 32-bit code and resources within the same application.  However, 32-bit modules 
  14317. that make calls to 16-bit modules or resources must be aware of the differences 
  14318. in addressing schemes between the the 16-bit and 32-bit environments. 
  14319.  
  14320.  
  14321. ΓòÉΓòÉΓòÉ 23. Mixing 16-Bit and 32-Bit Application Modules ΓòÉΓòÉΓòÉ
  14322.  
  14323. Under OS/2 Version 2.0, 32-bit applications may make use of existing 16-bit 
  14324. application code and resources; this practice is known as mixed model 
  14325. programming. For example, a 32-bit Presentation Manager application may access 
  14326. an object window procedure contained in a 16-bit DLL created for OS/2 Version 
  14327. 1.3.  This capability allows 32-bit applications to make use of existing 
  14328. application objects, avoiding the necessity to rewrite existing object 
  14329. libraries to accommodate the 32-bit programming environment. 
  14330.  
  14331. Applications that make use of 16-bit modules and resources must be aware of the 
  14332. particular characteristics of the 16-bit environment, which affect the way that 
  14333. application modules interface with one another and pass parameters or messages. 
  14334. Such characteristics include: 
  14335.  
  14336.  Pointers in the 16-bit environment are made up of a segment selector and an 
  14337.   offset; this addressing scheme is therefore known as 16. Pointers in the 
  14338.   32-bit environment are composed of a linear offset only; hence the addressing 
  14339.   scheme is known as 0:32.  Note that this difference in representation applies 
  14340.   not only to memory pointers, but also to window and resource handles under 
  14341.   Presentation Manager. 
  14342.  
  14343.  Memory objects passed as parameters between 16-bit and 32-bit routines must 
  14344.   not be greater than 64KB in size, in order to avoid problems with the 16-bit 
  14345.   segmented memory model. 
  14346.  
  14347.  Memory objects passed as parameters from 32-bit applications to 16-bit 
  14348.   routines must not lie across a segment boundary. 
  14349.  
  14350. Obviously, conversion of pointers and possible realignment of memory objects is 
  14351. required when passing control between 16-bit and 32-bit modules. This 
  14352. conversion between addressing schemes is known under OS/2 Version 2.0 as 
  14353. thunking. Thunking is performed using a simple algorithm known as the 
  14354. Compatibility Region Mapping Algorithm (CRMA).  This algorithm, along with 
  14355. sample code, is described in OS/2 Version 2.0 - Volume 1:  Control Program. 
  14356.  
  14357.  
  14358. ΓòÉΓòÉΓòÉ 23.1. Function Calls to 16-Bit Modules ΓòÉΓòÉΓòÉ
  14359.  
  14360. Thunking considerations affect the way in which a 16-bit function must be 
  14361. declared within the 32-bit module, and the way in which parameters to be passed 
  14362. to the 16-bit function are defined.  Such functions and parameters must be 
  14363. declared using the #pragma linkage directive and the far16 keyword, as shown in 
  14364. Figure "Declaring a 16-Bit Function in 32-Bit Code". 
  14365.  
  14366. Note the use of the #pragma stack16 directive to set the stack size for all 
  14367. 16-bit function calls made from the 32-bit module. 
  14368.  
  14369. Declaring a 16-bit function in this manner will cause the operating system to 
  14370. automatically perform thunking for all "value" parameters (that is, those other 
  14371. than pointers).  Pointers passed as parameters must be explicitly defined using 
  14372. the _Seg16 keyword, as shown in Figure "Declaring a 16-Bit Function in 32-Bit 
  14373. Code". 
  14374.  
  14375. The #pragma linkage and #pragma stack16 directives are discussed in more detail 
  14376. in the IBM C Set/2 User's Guide. 
  14377.  
  14378.  
  14379. ΓòÉΓòÉΓòÉ 23.2. Using 16-Bit Window Procedures ΓòÉΓòÉΓòÉ
  14380.  
  14381. A 32-bit application may access window procedures that reside in 16-bit 
  14382. modules, either statically linked or as DLLs.  However, the differences between 
  14383. addressing schemes require some consideration on the part of the developer, 
  14384. since both the window handles and any pointers passed as message parameters 
  14385. will differ in their representation. 
  14386.  
  14387.  
  14388. ΓòÉΓòÉΓòÉ 23.2.1. Creating a Window ΓòÉΓòÉΓòÉ
  14389.  
  14390. When a 32-bit application module creates a window, and the window procedure for 
  14391. that window resides in a 16-bit module (either statically linked or in a DLL), 
  14392. the calling routine must explicitly declare the 16-bit nature of the window 
  14393. procedure's entry point when registering the window class.  This may become 
  14394. rather complex, since it involves invoking a 32-bit entry point from a 32-bit 
  14395. module, but passing a 16-bit entry point as a parameter. 
  14396.  
  14397. A simpler solution is to build a registration routine within the 16-bit module, 
  14398. which registers the window class and creates the window.  The 32-bit module 
  14399. then need only invoke this routine, and allow for the resulting 16-bit window 
  14400. handle.  This technique has the added advantage that Presentation Manager 
  14401. records the fact that the window was registered from a 16-bit module, and will 
  14402. automatically perform thunking for system-defined message classes.  The 
  14403. technique is illustrated in Figure "Creating a 16-bit Window From Within a 
  14404. 32-bit Module". 
  14405.  
  14406. Since the 16-bit module would typically be a DLL, the registration routine is 
  14407. declared in the 16-bit module as an exportable entry point using the EXPENTRY 
  14408. keyword. 
  14409.  
  14410. The 32-bit module declares the registration routine MakeMyWindow() as a 16-bit 
  14411. function using the #pragma linkage directive with the far16 keyword. Since in 
  14412. 16-bit code, the EXPENTRY keyword forces use of the pascal calling convention, 
  14413. the directive also specifies this calling convention.  Note that if the 
  14414. registration routine and the window procedure were to reside in a DLL, this 
  14415. declaration would typically take place within a header file provided by the 
  14416. developer of the DLL. 
  14417.  
  14418. The 32-bit module invokes the registration routine that registers the window 
  14419. class and creates the window.  The registration routine then returns the window 
  14420. handle to the 32-bit module, which stores it in 16:16 format. Note that the 
  14421. registration routine in the 16-bit module is not aware that it is being called 
  14422. from a 32-bit module. 
  14423.  
  14424. This approach allows the same DLL to be accessed by both 16-bit and 32-bit 
  14425. applications concurrently.  The developer of the DLL simply provides two 
  14426. separate header files containing declarations of the DLL's entry points, in the 
  14427. appropriate format for each programming environment. 
  14428.  
  14429.  
  14430. ΓòÉΓòÉΓòÉ 23.2.2. Passing Messages to 16-Bit Windows ΓòÉΓòÉΓòÉ
  14431.  
  14432. Passing data between 16-bit and 32-bit window procedures via message parameters 
  14433. also requires consideration of the internal representations of the data types 
  14434. passed within the parameter.  For system-defined message classes, this is 
  14435. handled automatically by OS/2 Version 2.0, but for application-defined message 
  14436. classes the conversion between addressing schemes must be handled by the 
  14437. application, since the operating system has no way of determining the intended 
  14438. contents of each parameter. 
  14439.  
  14440. Simple "value" parameters (such as integers, characters, etc.) may be passed 
  14441. without the need for translation.  It is recommended that message parameters be 
  14442. constructed using the standard Presentation Manager macros described in 
  14443. Creating Message Parameters. 
  14444.  
  14445. When a pointer or handle is passed in a message parameter to a 16-bit window 
  14446. procedure, the pointer or handle must be translated to the 16:16 addressing 
  14447. scheme by the application.  Since the 16-bit module is unlikely to have been 
  14448. written with code to achieve this conversion, it is the responsibility of the 
  14449. 32-bit module. 
  14450.  
  14451. Conversion may be achieved using the _Seg16 keyword to explicitly define a 
  14452. 16:16 pointer or handle, which is then placed in a message parameter using the 
  14453. MPFROMP macro.  This is illustrated in Figure "Passing a 16:16 Pointer as a 
  14454. Message Parameter". 
  14455.  
  14456. The resulting message parameter may then be passed to a window in a 16-bit 
  14457. module using the normal WinPostMsg() or WinSendMsg() functions, using a 16:16 
  14458. window handle obtained in the manner shown in Figure "Creating a 16-bit Window 
  14459. From Within a 32-bit Module".  Note that the data structure referenced by the 
  14460. pointer may not be greater than 64 KB in size, and must not cross a segment 
  14461. boundary.  This is ensured in Figure "Passing a 16:16 Pointer as a Message 
  14462. Parameter" by using the #pragma seg16 directive, since a structure defined 
  14463. using this pragma will automatically be aligned on a segment boundary by the C 
  14464. Set/2 compiler. 
  14465.  
  14466. Note also that defining a structure with the #pragma seg16 directive does not 
  14467. implicitly qualify pointers within the structure with the _Seg16 keyword.  Such 
  14468. pointers must be explicitly qualified, as shown in Figure "Creating a 16-bit 
  14469. Window From Within a 32-bit Module".  Further information on the #pragma seg16 
  14470. directive can be found in the IBM C Set/2 User's Guide. 
  14471.  
  14472. A 0:32 pointer may also be converted to a 16:16 pointer using the 
  14473. DosFlattoSel() function provided by OS/2 Version 2.0.  This function provides 
  14474. the correct remapping of pointer formats from the 32-bit flat memory model to 
  14475. the 16-bit segmented memory model. 
  14476.  
  14477.  
  14478. ΓòÉΓòÉΓòÉ 23.2.3. Passing Messages to 32-Bit Windows ΓòÉΓòÉΓòÉ
  14479.  
  14480. The technique described above handles messages passed to a window in a 16-bit 
  14481. module.  However, messages passed from that window to the 32-bit module may 
  14482. also require thunking.  In order to perform this thunking, the 32-bit 
  14483. application may define a thunk procedure and register this procedure to 
  14484. Presentation Manager, which then invokes the thunk procedure whenever a message 
  14485. is passed from within the window. 
  14486.  
  14487. This registration is achieved using the WinSetWindowThunkProc() function, which 
  14488. is illustrated in Figure "Mixed Model Programming - WinSetWindowThunkProc() 
  14489. Function". 
  14490.  
  14491. The WinSetWindowThunkProc() function call is made from the 32-bit module. Since 
  14492. the window class for the window has been registered in the 16-bit module, 
  14493. Presentation Manager recognizes that the thunk procedure is to handle 16-bit to 
  14494. 32-bit conversion. 
  14495.  
  14496. A thunk procedure may be deregistered, by issuing a WinSetWindowThunkProc() 
  14497. function call with the thunk procedure entry point address set to NULL. 
  14498.  
  14499. Whenever Presentation Manager invokes a thunk procedure for a message, it 
  14500. passes the normal four parameters accepted by a window procedure, along with 
  14501. the entry point address of the window procedure to which the message was to be 
  14502. passed.  This may be the window procedure defined for the destination window 
  14503. when its class was registered, or a subclass window procedure defined by the 
  14504. application.  Thus thunking may take place, irrespective of whether a window 
  14505. has been subclassed. 
  14506.  
  14507. A sample thunk procedure is shown in Figure "Mixed Model Programming - Thunk 
  14508. Procedure". 
  14509.  
  14510. The thunk procedure is invoked whenever a message is passed by the window in 
  14511. the 16-bit module to a window in the 32-bit module.  The thunk procedure is 
  14512. similar in structure to a "normal" window procedure, but need contain cases 
  14513. only for application-defined message classes, since thunking for system-defined 
  14514. message classes is performed by Presentation Manager. 
  14515.  
  14516. Note that since the thunk procedure is invoked by Presentation Manager, it must 
  14517. use the system linkage convention, and is thus declared using the EXPENTRY 
  14518. keyword. 
  14519.  
  14520. In Figure "Mixed Model Programming - Thunk Procedure", the 16-bit window 
  14521. contains two application-defined message classes, WMP_MSG1 and WMP_MSG2.  The 
  14522. first of these contains pointers in both parameters, and thus both parameters 
  14523. are thunked by the thunk procedure.  The second message class contains a 
  14524. pointer in the first message paramater only; the second may contain an integer 
  14525. or some simple value parameter which does not require explicit thunking. 
  14526. Thunking is performed using the DosSeltoFlat() function provided by OS/2 
  14527. Version 2.0. 
  14528.  
  14529. After performing the necessary thunking, the thunk procedure directly calls the 
  14530. window procedure entry point supplied by Presentation Manager when the thunk 
  14531. procedure is invoked.  Note that this is one of the few instances where direct 
  14532. invocation of a window procedure should be used.  The correct sequence of 
  14533. message processing is preserved in this case because the thunk procedure itself 
  14534. is invoked either synchronously or asynchronously by Presentation Manager, 
  14535. depending upon whether the message was sent or posted by the 16-bit window. 
  14536.  
  14537. An alternative to the use of the DosSeltoFlat() function is the explicit use of 
  14538. the Compability Region Mapping Algorithm discussed in OS/2 Version 2.0 - Volume 
  14539. 1: Control Program.  This algorithm is implemented in the subroutine CRMA16to32 
  14540. shown in Figure "16:16 to 0:32 Address Conversion". 
  14541.  
  14542. The use of the DosSeltoFlat() function should be the preferred option, since 
  14543. the CRMA routines may fail under certain circumstances.  Explicit use of CRMA 
  14544. should be restricted to those situations where special processing must be 
  14545. performed on the parameters being passed. 
  14546.  
  14547.  
  14548. ΓòÉΓòÉΓòÉ 23.3. Summary ΓòÉΓòÉΓòÉ
  14549.  
  14550. OS/2 Version 2.0 allows applications and resources from both 16-bit and 32-bit 
  14551. environments to coexist and communicate.  A 32-bit application may make 
  14552. function calls to 16-bit code, and 16-bit and 32-bit window procedures may pass 
  14553. messages between one another. 
  14554.  
  14555. Conversion between the 16:16 and 0:32 addressing schemes is achieved using 
  14556. thunks, which implement an algorithm known as the Compatibility Region Mapping 
  14557. Algorithm.  The IBM C Set/2 compiler provides transparent thunking for most 
  14558. function calls and parameters, using the #pragma linkage directive in 
  14559. conjunction with the _Seg16 keyword. 
  14560.  
  14561. For threads that will make calls to 16-bit code, the stack must also be aligned 
  14562. on a 64KB segment boundary, to avoid possible problems with stack overflow in 
  14563. the 16-bit code.  Again, the IBM C Set/2 compiler facilitates this alignment 
  14564. through use of the #pragma stack16 directive, which causes the thread's stack 
  14565. to be automatically aligned on a 64KB boundary. 
  14566.  
  14567. Thunking becomes slightly more complex when communicating between 16-bit and 
  14568. 32-bit window procedures, since pointers passed in message parameters must be 
  14569. thunked.  While Presentation Manager provides transparent thunking for all 
  14570. system-defined message classes, application-defined messages must be thunked 
  14571. explicitly by the application. 
  14572.  
  14573. Presentation Manager provides some assistance to the application developer by 
  14574. allowing thunk procedures to be registered for a window.  Presentation Manager 
  14575. automatically invokes the thunk procedure whenever a message to passed to that 
  14576. window from a window of another memory model. 
  14577.  
  14578. The ability to mix 16-bit and 32-bit code in the same application provides 
  14579. considerable flexibility and protects investment in existing application 
  14580. functions and resources.  This in turn eases the task of migrating the 
  14581. organizational development environment from the 16-bit to the 32-bit 
  14582. environment, since the transition need not be accomplished in a single step. 
  14583.  
  14584.  
  14585. ΓòÉΓòÉΓòÉ 24. Compiling and Link Editing an Application ΓòÉΓòÉΓòÉ
  14586.  
  14587. A Presentation Manager application, written in a high-level language such as C, 
  14588. is compiled and link-edited in a similar fashion to a regular OS/2 or DOS 
  14589. application.  System Object Model object classes are created in a similar way. 
  14590. However, additional steps are required for the creation of a Workplace Shell 
  14591. object class, prior to compilation of the C source code. 
  14592.  
  14593. This chapter describes the process of creating an executable Presentation 
  14594. Manager application or system object model object class.  The chapter describes 
  14595. the process of precompilation for system object model object classes, and the 
  14596. compilation, link edit and resource compilation stages for both system object 
  14597. model object classes and Presentation Manager applications. 
  14598.  
  14599. Figure "Development Process for New WPS Classes" shows the overall process used 
  14600. to create a new class in the Workplace Shell: 
  14601.  
  14602. The starting point for a system object model class is the class definition file 
  14603. which, for classes written using the C language, has an extension of .CSC.  The 
  14604. class definition file is used as input to the SOM Precompiler, which will 
  14605. generate a number of files from the class definition file: 
  14606.  
  14607. .H     A public header file for programs that use the class. 
  14608.  
  14609. .PH    A private header file, which provides usage bindings to any private 
  14610.        methods implemented by the class. 
  14611.  
  14612. .IH    An implementation header file, which provides macros, etc., to support 
  14613.        the implementation of the class. 
  14614.  
  14615. .C     A template C file, to which code may be added to implement the class. 
  14616.  
  14617. .SC    A language-neutral class definition. 
  14618.  
  14619. .PSC   A private language-neutral core file, which contains private parts of 
  14620.        the interface for the class. 
  14621.  
  14622. .DEF   An OS/2 DLL module definition file containing the relevant exports 
  14623.        needed to implement the class. 
  14624.  
  14625.  
  14626. ΓòÉΓòÉΓòÉ 24.1. Running the SOM Precompiler ΓòÉΓòÉΓòÉ
  14627.  
  14628. Once the class definition file has been created, the SOM Precompiler is used to 
  14629. generate the source files for the class.  The options for the SOM Precompiler 
  14630. are described in detail in the IBM SOM Programming Reference; however, a brief 
  14631. description of the options used to create the folder example is given below. 
  14632.  
  14633.  
  14634. ΓòÉΓòÉΓòÉ 24.1.1. The Makefile ΓòÉΓòÉΓòÉ
  14635.  
  14636. The instructions to be used are placed into a makefile.  The new make facility 
  14637. NMAKE, provided with the IBM Developer's Toolkit for OS/2 2.0 is extremely 
  14638. flexible and rich in function.  It is recommended that programmers read the 
  14639. NMAKE section of the IBM OS/2 Version 2.0 Programming Tools Reference if 
  14640. unfamiliar with makefiles. 
  14641.  
  14642. The SOM Precompiler environment variables are set as follows: 
  14643.  
  14644. !if [set SMINCLUDE=.;$(SCPATH);] || \
  14645.     [set SMTMP=$(SOMTEMP)] || \
  14646.     [set SMEMIT=ih;h;ph;psc;sc;c;def]
  14647. !endif
  14648.  
  14649. The use of the !if directive is somewhat confusing, as the statement has 
  14650. nothing to do with a conditional command.  In fact, the OS/2 SET command is 
  14651. being executed to initialize the environment variables.  The NMAKE utility 
  14652. executes any OS/2 command placed within square brackets in a !if directive. 
  14653.  
  14654. The SMEMIT environment variable tells the SOM Precompiler  which C source files 
  14655. are to be generated; the suffixes correspond to the file types described 
  14656. earlier in this chapter. 
  14657.  
  14658. The SMINCLUDE and SMTMP environment variables are set from two NMAKE macros, 
  14659. which are defined at the top of the makefile: 
  14660.  
  14661.    SCPATH  = D:\toolkt20\sc
  14662.    SOMTEMP = .\somtemp
  14663.  
  14664. The SMINCLUDE variable tells the SOM Precompiler where to find the class 
  14665. definition (.SC) include files. 
  14666.  
  14667. The SMTMP variable locates the SOM Precompiler temporary workspace directory. 
  14668.  
  14669. This brings us to the next part of the makefile that is responsible for 
  14670. ensuring the existence of the temporary directory. 
  14671.  
  14672. !if [cd $(SOMTEMP)]
  14673. !  if [md $(SOMTEMP)]
  14674. !    error Error creating $(SOMTEMP) directory
  14675. !  endif
  14676. !else
  14677. !  if [cd ..]
  14678. !    error Error could not cd .. from $(SOMTEMP) directory
  14679. !  endif
  14680. !endif
  14681.  
  14682. This code checks for the existence of the directory and if it cannot be found, 
  14683. attempts to create it. 
  14684.  
  14685.  
  14686. ΓòÉΓòÉΓòÉ 24.1.2. SOM Precompiler Invocation ΓòÉΓòÉΓòÉ
  14687.  
  14688. The SOM Precompiler is invoked as a consequence of the following NMAKE 
  14689. inference rule: 
  14690.  
  14691.    .csc.c:
  14692.         sc $<
  14693.  
  14694. This infers that to go from a .CSC file to a ".C" file the SOM Precompiler 
  14695. (sc.exe) will be invoked on the .CSC file ("$<"). 
  14696.  
  14697. Note that for the folder example, many default SOM Precompiler options are 
  14698. used. Readers may wish to investigate some of the other options that are 
  14699. available, by checking the IBM SOM Programming Reference. 
  14700.  
  14701.  
  14702. ΓòÉΓòÉΓòÉ 24.2. Compiling C Source Code ΓòÉΓòÉΓòÉ
  14703.  
  14704. The following files are required to generate a system object model object class 
  14705. or Presentation Manager application from "C" source code: 
  14706.  
  14707. Source         An application may contain one or more source modules; multiple 
  14708.                source modules are normally bound at link-edit time.  However, 
  14709.                application routines may be compiled and placed in a DLL for 
  14710.                binding at execution time. 
  14711.  
  14712. H              An application may use a header file that contains data type 
  14713.                definitions, constants and macro definitions for use by the 
  14714.                application. 
  14715.  
  14716. DEF            A module definition file, while not required for all 
  14717.                Presentation Manager applications, is definitely recommended. 
  14718.                This file contains information for input to the link editor, as 
  14719.                described in Module Definition File. 
  14720.  
  14721. RC             A resource script file contains definitions for Presentation 
  14722.                Manager resources, and/or statements that include resources from 
  14723.                other files. 
  14724.  
  14725. DLG            If an application uses a dialog box, a dialog file is normally 
  14726.                created containing a definition for the dialog box and its 
  14727.                control windows.  This file is normally included into the 
  14728.                resource script file using an appropriate statement. 
  14729.  
  14730. The role of these files in the development of a Presentation Manager 
  14731. application is illustrated in Figure "Compiling and Linking an OS/2 
  14732. Presentation Manager Application". 
  14733.  
  14734. Note that certain additional header files are generated by the SOM Precompiler 
  14735. and used in compiling a system object model object class.  These files are 
  14736. typically header files used to link the class with its parent, and have no 
  14737. direct bearing on the compilation process. 
  14738.  
  14739. The following steps are required to compile and link-edit a Presentation 
  14740. Manager application: 
  14741.  
  14742.  1. Compile the source file using a high-level language compiler, to produce an 
  14743.     object file (usually with an extension of .OBJ). 
  14744.  
  14745.  2. Link-edit the object file with any other required object files, and 
  14746.     possibly one or more run-time libraries, to create an executable file 
  14747.     (usually with an extension of .EXE). 
  14748.  
  14749.  3. Compile any Presentation Manager resources using the resource compiler, and 
  14750.     incorporate these resources into the application's executable code or place 
  14751.     them in a DLL module. 
  14752.  
  14753. A number of compiler and link editor options are specified for Presentation 
  14754. Manager applications; these are shown in the example below.  The executable 
  14755. file may then be run as a Presentation Manager application under OS/2. 
  14756.  
  14757. Note that the third step above is not required if Presentation Manager 
  14758. resources are not used by the application.  However, it is envisaged that 
  14759. virtually all Presentation Manager applications will make some use of 
  14760. resources, due to the benefits to be gained through externalization of 
  14761. logic-independent or language-specific application components. 
  14762.  
  14763. Note that the command sequences for compiling and link editing an application 
  14764. may be combined and placed in a parameterized OS/2 command file for automated 
  14765. execution.  Alternatively, a makefile may be created and the NMAKE utility used 
  14766. to compile and link edit the application. 
  14767.  
  14768.  
  14769. ΓòÉΓòÉΓòÉ 24.2.1. Module Definition File ΓòÉΓòÉΓòÉ
  14770.  
  14771. The module definition file is a simple text file required by most Presentation 
  14772. Manager applications.  Module definition files are used when link editing both 
  14773. programs and dynamic link libraries.  By convention, the module definition file 
  14774. has the same name as the program or library source file, but with an extension 
  14775. of DEF. 
  14776.  
  14777. A sample module definition file for a simple Presentation Manager application 
  14778. is shown in Figure "Sample Module Definition File for Presentation Manager." 
  14779.  
  14780. A module definition file normally begins with a NAME or LIBRARY statement, 
  14781. which identifies the module as a program or DLL respectively, and assigns it a 
  14782. module name.  The keyword WINDOWCOMPAT may be used to specify a full-screen 
  14783. application that may be run in a Presentation Manager text window, or WINDOWAPI 
  14784. may be used to specify a full Presentation Manager application. 
  14785.  
  14786. The module definition file also contains a DESCRIPTION entry, containing text 
  14787. that is embedded by the link editor into the header of the executable module. 
  14788. This text may contain information such as a copyright notice or author 
  14789. information concerning the module. 
  14790.  
  14791. The PROTMODE keyword should be used to indicate that the application will be 
  14792. run only in protect mode under OS/2 (note that this is a standard provision; 
  14793. all Presentation Manager applications must run in protect mode).  This allows 
  14794. the link editor to shorten the header in the executable module. 
  14795.  
  14796. The STUB keyword instructs the link editor to set up a stub file that generates 
  14797. an error message if the user attempts to execute the application in a DOS 
  14798. environment.  OS2STUB.EXE is a DOS executable file that performs this function, 
  14799. and is provided with the IBM Developer's Toolkit for OS/2 2.0. 
  14800.  
  14801. A DATA statement may be used in the module definition file to indicate the 
  14802. disposition of data segments created by the module.  Data segments may be 
  14803. specified as SHARED, NONSHARED or NONE.  If SHARED is specified, different 
  14804. processes using the code segments of a dynamic link library will share the same 
  14805. data segments; if NONSHARED is specified, the operating system will create a 
  14806. new set of data segments for each process using a DLL.  NONSHARED is 
  14807. recommended. 
  14808.  
  14809. The STACKSIZE and HEAPSIZE statements specify the size of the memory areas to 
  14810. be reserved for the application's stack and for the local heap in the program's 
  14811. automatic data segment.  Note that the recommended minimum stack size for 
  14812. Presentation Manager applications is 8 KB.  Note also that STACKSIZE is not 
  14813. used for dynamic link library modules, since a DLL has no stack (see Creating a 
  14814. DLL). 
  14815.  
  14816. The module definition file may also contain an EXPORTS statement for all 
  14817. exportable entry points (such as window procedures) window procedures contained 
  14818. in the module.  This statement causes the entry points for window procedures to 
  14819. be defined in the header of an executable module, so that they may later be 
  14820. called from outside the current executable module (since window procedures are 
  14821. actually invoked by Presentation Manager on behalf of the application, rather 
  14822. than directly by the application itself). 
  14823.  
  14824. An IMPORTS statement may be used to define the entry points for those functions 
  14825. and/or resource definitions that will be imported from a dynamic link library. 
  14826. However, an IMPORTS statement is not required if an import library is being 
  14827. link edited with the application (see Using a DLL). 
  14828.  
  14829. The module definition file, and the statements it may contain, are described 
  14830. fully in the IBM OS/2 Version 2.0 Application Design Guide. 
  14831.  
  14832.  
  14833. ΓòÉΓòÉΓòÉ 24.2.2. Compiler Options ΓòÉΓòÉΓòÉ
  14834.  
  14835. Using the IBM C Set/2 compiler, the following command sequence is recommended: 
  14836.  
  14837. cc /C+ /L+ /G3 /Ti+ MYPROG
  14838.  
  14839. The /C+ option indicates that only the compile step should be run, and not the 
  14840. link-edit step, which is then performed explicitly at a later point using the 
  14841. LINK386 utility.  The /L+ option causes the compiler to produce a source 
  14842. listing file. 
  14843.  
  14844. The /G3 option optimizes the code for execution on an Intel 80386 processor. 
  14845. The code will also execute on an 80486 processor.  However, for code that will 
  14846. mainly be executed on 80486 hardware, use of the /G4 option is recommended. 
  14847. See the IBM C Set/2 User's Guide for further information. 
  14848.  
  14849. The /Ti+ option instructs the compiler to generate symbolic debugging 
  14850. information which may then be used when debugging the application with the IBM 
  14851. C Set/2 debugging tool. 
  14852.  
  14853.  
  14854. ΓòÉΓòÉΓòÉ 24.3. Link Edit ΓòÉΓòÉΓòÉ
  14855.  
  14856. When using the IBM C Set/2 compiler, an application may be compiled and 
  14857. link-edited in a single operation.  The following command sequence is used to 
  14858. compile and link edit a program for Presentation Manager under OS/2 Version 
  14859. 2.0: 
  14860.  
  14861. CC /L- /G3 /Ti+ /Gm+ MYPROG OS2386.LIB MYPROG.DEF
  14862.  
  14863. This command sequence directs the linkage editor to compile the file MYPROG.C 
  14864. to produce an object file named MYPROG.OBJ, and to link this file to produce an 
  14865. executable file named MYPROG.EXE, without creating a list file, to use the 
  14866. run-time library named OS2386.LIB and the module definition file named 
  14867. MYPROG.DEF. 
  14868.  
  14869. Note the use of the /Gm+ option.  This option causes the multithreading "C" 
  14870. run-time libraries to be used in linking, thereby enabling multithreadingin the 
  14871. resulting application code. 
  14872.  
  14873.  
  14874. ΓòÉΓòÉΓòÉ 24.4. Resource Compilation ΓòÉΓòÉΓòÉ
  14875.  
  14876. Presentation Manager resources used by the application and defined in a 
  14877. resource script file are compiled using the resource compiler provided in the 
  14878. IBM Developer's Toolkit for OS/2 2.0.  The command sequence used to invoke the 
  14879. resource compiler is as follows: 
  14880.  
  14881. rc MYPROG.RC MYPROG.EXE
  14882.  
  14883. This command sequence causes the resource compiler to read the resource 
  14884. definitions from the resource script file MYPROG.RC and compile them to produce 
  14885. an intermediate resource file MYPROG.RES, which is then incorporated into the 
  14886. executable module MYPROG.EXE. 
  14887.  
  14888. Resources may also be compiled and incorporated into dynamic link libraries, 
  14889. simply by specifying the name of the DLL rather than the EXE file when invoking 
  14890. the resource compiler.  Note that certain additional considerations may apply; 
  14891. see Presentation Manager Resources in a DLL for further information. 
  14892.  
  14893. Note that under OS/2 Version 2.0, 32-bit applications may use existing 16-bit 
  14894. application modules and resources.  This concept is known as mixed model 
  14895. programming, and is discussed in Mixing 16-Bit and 32-Bit Application Modules. 
  14896.  
  14897.  
  14898. ΓòÉΓòÉΓòÉ 24.5. Dynamic Link Libraries ΓòÉΓòÉΓòÉ
  14899.  
  14900. Since window procedures that communicate using the standard Presentation 
  14901. Manager message conventions have no exterior interfaces aside from these 
  14902. messages, window procedures are essentially "black boxes" and are invisible to 
  14903. the application.  It is thus possible to produce a number of window procedures 
  14904. to perform standard or often-used functions, and to store these window 
  14905. procedures in a library from which they may be accessed by a number of 
  14906. applications. 
  14907.  
  14908. The recommended way to achieve this capability is to place such window 
  14909. procedures in an OS/2 dynamic link library. [See Dynamic Linking for an 
  14910. explanation of the concept of dynamic linking. ] Applications using these 
  14911. window procedures then reap the benefits of DLLs; namely that changes to window 
  14912. procedures contained in the DLLs do not require the applications to be 
  14913. re-linked and that multiple applications may use the same memory-resident copy 
  14914. of the window procedure code, since DLLs are re-entrant.  The use of DLLs 
  14915. therefore maximizes the potential for code reuse, and facilitates the 
  14916. containment of change within a single application module. 
  14917.  
  14918. Note that where existing 16-bit DLLs contain application objects, functions or 
  14919. resources required by 32-bit applications under OS/2 Version 2.0, these 
  14920. applications may access the 16-bit DLLs.  This technique, known as mixed model 
  14921. programming, is discussed in Mixing 16-Bit and 32-Bit Application Modules. 
  14922.  
  14923.  
  14924. ΓòÉΓòÉΓòÉ 24.5.1. Creating a DLL ΓòÉΓòÉΓòÉ
  14925.  
  14926. To build a DLL from a particular source code module, the code is compiled in a 
  14927. similar manner to that used for any other Presentation Manager application 
  14928. code.  However, use of the /Ge- option will cause the C Set/2 compiler to 
  14929. produce a DLL module. 
  14930.  
  14931. CC /L- /G3 /Ti+ /Gm+ /Ge- MYDLL OS2386.LIB MYDLL.DEF
  14932.  
  14933. This command sequence instructs the compiler to take the file MYPROG.C, to 
  14934. compile and link edit it to produce a dynamic link library named MYPROG.DLL, 
  14935. and to use the file named MYPROG.DEF as input to the linking process.  Use of 
  14936. the /Gm+ option enables multithreading, and use of the /Ge- option directs C 
  14937. Set/2 to produce a DLL module. 
  14938.  
  14939. A sample module definition file for use when creating a DLL is shown in Figure 
  14940. "Sample Module Definition File to Create a DLL": 
  14941.  
  14942. The following rules apply to module definition files when used to create 
  14943. dynamic link libraries: 
  14944.  
  14945.  The LIBRARY statement must be used, and the module name declared must be the 
  14946.   same as the file name of the DLL.  The keywords INITINSTANCE and TERMINSTANCE 
  14947.   may be used to indicate that any initialization code should be executed for 
  14948.   each process which accesses the DLL. 
  14949.  
  14950.  If the DLL will be accessed by separate processes within the system, separate 
  14951.   data segments should be created for each process; this is achieved by 
  14952.   specifying DATA MULTIPLE in the module definition file 
  14953.  
  14954.  The STACKSIZE statement must not be used since a DLL does not use a stack. 
  14955.  
  14956.  An EXPORTS statement must be included, defining each function that will be 
  14957.   exported from the DLL. 
  14958.  
  14959. The DLL module must be copied to a directory referenced by the LIBPATH 
  14960. statement in CONFIG.SYS. This is typically the C:\OS2\DLL directory, although 
  14961. another directory may be used if so desired. 
  14962.  
  14963.  
  14964. ΓòÉΓòÉΓòÉ 24.5.2. Using a DLL ΓòÉΓòÉΓòÉ
  14965.  
  14966. When an application is to use functions contained in a DLL, these functions 
  14967. must first be declared at compilation time.  This is typically achieved by the 
  14968. use of an include file containing function prototypes for all exportable entry 
  14969. points within the DLL; such an include file is normally created along with the 
  14970. DLL and supplied to all application developers who will use the DLL. 
  14971.  
  14972. Once the functions are declared within the application's source code, the 
  14973. external references must be resolved at the time the program is link edited. 
  14974. This may be performed in one of two ways: 
  14975.  
  14976.  The functions may be identified in the application's module definition file 
  14977.   using an IMPORTS statement, as described in Module Definition File.  For 
  14978.   example, the statement: 
  14979.  
  14980.     IMPORTS MYPROG.func1
  14981.  
  14982.   defines the function func1, which will be imported from a DLL named 
  14983.   MYPROG.DLL. 
  14984.  
  14985.  The functions may be included in an import library, which is a library 
  14986.   specified at link edit time.  An import library is created using the IMPLIB 
  14987.   utility provided with the IBM Developer's Toolkit for OS/2 2.0.  For example, 
  14988.   the command: 
  14989.  
  14990.     implib MYLIB.LIB MYLIB.DEF
  14991.  
  14992.   causes IMPLIB to create an import library named MYLIB.LIB, using information 
  14993.   contained in a module definition file named MYLIB.DEF.  The import library 
  14994.   file should be placed in a directory referenced by the INCLUDE environment 
  14995.   variable. 
  14996.  
  14997. Note that the file OS2.LIB, used when link editing OS/2 application programs, 
  14998. is in fact an import library containing definitions for OS/2 system functions 
  14999. that are themselves implemented using DLLs. 
  15000.  
  15001.  
  15002. ΓòÉΓòÉΓòÉ 24.5.3. Presentation Manager Resources in a DLL ΓòÉΓòÉΓòÉ
  15003.  
  15004. As noted in Dynamic Linking, Presentation Manager resources may be defined and 
  15005. stored in a DLL for use by multiple applications.  However, the implementation 
  15006. of dynamic linking under OS/2 requires that each DLL must contain an executable 
  15007. module, and resources are not executable modules in their own right.  If a DLL 
  15008. will contain only resources and will not contain an executable routine such as 
  15009. a dialog procedure, a dummy executable module must be provided for the DLL by 
  15010. the application developer, as shown below: 
  15011.  
  15012. int ARCTUSED = 1;
  15013.  
  15014. void EXPENTRY dummy()
  15015. {
  15016. }
  15017.  
  15018. The declaration for the variable ARCTUSED is provided in order to avoid an 
  15019. error generated by the IBM C/2 compiler when it cannot find a module named main 
  15020. within the source file. 
  15021.  
  15022. Editor's Note:  The above statement may not be true for the C Set/2 compiler. 
  15023.                 This must be determined. 
  15024.  
  15025. This dummy module is compiled and link-edited into an executable file in the 
  15026. normal way.  The resource compiler is then used to compile and incorporate the 
  15027. resource definitions into the executable file. 
  15028.  
  15029.  
  15030. ΓòÉΓòÉΓòÉ 24.5.4. Using Dialogs in System Object Model Objects ΓòÉΓòÉΓòÉ
  15031.  
  15032. In the folder example, a dialog box is used to prompt the user for the folder's 
  15033. password, and for the user to enter the password.  Creating and invoking the 
  15034. dialog is done in the normal way.  However, invoking an object's methods from 
  15035. within a dialog procedure requires that the dialog procedure know the pointer 
  15036. to the object that invokes the method (that is, somSelf).  This is done through 
  15037. the use of the pCreateParams parameter of the WinDialogBox() function.  In this 
  15038. way, the pointer to somSelf is passed to the dialog procedure as follows: 
  15039.  
  15040.    pCreateParams = (PVOID)somSelf;
  15041.  
  15042. The dialog procedure may then store the pointer in the reserved window word 
  15043. QWL_USER: 
  15044.  
  15045.     case WM_INITDLG:
  15046.          WinSetWindowULong(hwndDlg,      /* Set window word           */
  15047.                            QWL_USER,     /* Offset of window word     */
  15048.                            (ULONG) mp2); /* Value to be stored        */
  15049.         break;
  15050.  
  15051. When an instance method must be invoked from the dialog procedure, the object 
  15052. pointer may easily be retrieved from the window words and used to invoke the 
  15053. method. 
  15054.  
  15055.    {
  15056.       PWFolder *aPWF;                         /* Object pointer       */
  15057.  
  15058.       PWF_INFO pwfolderInfo;                  /* Folder info struct   */
  15059.  
  15060.       aPWF = (PWFolder *)WinQueryWindowULong( /* Get object pointer   */
  15061.                             hwndDlg,          /* Dialog box handle    */
  15062.                             QWL_USER);        /* Offset of win word   */
  15063.  
  15064.       _QueryInfo(                             /* Invoke method        */
  15065.                  aPWF,                        /* Object pointer       */
  15066.                  &pwfolderInfo);              /* Folder info struct   */
  15067.    }
  15068.  
  15069. In the above example, a WinQueryWindowULong() call is used to retrieve the 
  15070. object pointer from the window word, and store it in aPWF.  This variable is 
  15071. then used as the first parameter when invoking the method _QueryInfo. 
  15072.  
  15073. Note that the method name _QueryInfo is in fact fully defined as 
  15074. pwfolder_QueryInfo.  However, as noted in C Implementation of an Object Class, 
  15075. the SOM Precompiler automatically generates a macro to define the abbreviated 
  15076. form of the function name, in order to avoid the necessity for the programmer 
  15077. to type the full name. 
  15078.  
  15079.  
  15080. ΓòÉΓòÉΓòÉ 24.6. Summary ΓòÉΓòÉΓòÉ
  15081.  
  15082. The steps required in compiling and link-editing a Presentation Manager 
  15083. application are generally similar to those required to generate any other OS/2 
  15084. application. Some files are required in addition to those used by a 
  15085. "conventional" application, due to Presentation Manager's use of externalized 
  15086. definitions for application resources such as menus, string tables and dialog 
  15087. boxes. 
  15088.  
  15089. The module definition file provides a mechanism whereby various attributes of 
  15090. an application or dynamic link library may be specified.  The module definition 
  15091. file also allows the developer to specify copyright information that is 
  15092. imbedded in the executable code. 
  15093.  
  15094. The creation of dynamic link libraries, while essentially similar to that of 
  15095. normal application code, requires certain special considerations, notably with 
  15096. regard to the module definition file and the options that are specified at 
  15097. link-edit time.  Code modules and Presentation Manager resources that are 
  15098. likely to be subject to change, or are of a potentially reusable nature may be 
  15099. placed in dynamic link libraries and thus isolated from the remainder of the 
  15100. application.  The remainder of the application code is thus protected from 
  15101. changes that may be necessary to these dynamic link libraries in order to 
  15102. accommodate changes in such areas as organizational procedures or government 
  15103. legislation.  Dynamic link libraries may also be used by multiple applications 
  15104. concurrently, by virtue of their reentrant nature. 
  15105.  
  15106.  
  15107. ΓòÉΓòÉΓòÉ 25. Adding Online Help and Documentation ΓòÉΓòÉΓòÉ
  15108.  
  15109. In line with the philosophy of making applications easy to use through the 
  15110. provision of an intuitive, graphical user interface, it is extremely useful to 
  15111. have an application provide online, context-sensitive help and tutorial 
  15112. facilities to the end user.  Such facilities further encourage learning by 
  15113. exploration. 
  15114.  
  15115. Presentation Manager provides such capabilities in the form of the Information 
  15116. Presentation Facility (IPF), which allows help panels to be generated and 
  15117. displayed in help windows under Presentation Manager.  These help windows are 
  15118. linked with the normal application windows in such a way that when the user 
  15119. presses the "Help" key, selects a "Help" item from the menu bar or presses a 
  15120. "Help" button in a dialog box, the appropriate help window is displayed. 
  15121.  
  15122. In addition to providing online help for Presentation Manager applications, IPF 
  15123. can also be used in a stand-alone mode, to provide online documentation for 
  15124. applications, or for business procedures that are independent of any single 
  15125. application.  Using capabilities provided by IPF, an online procedure manual 
  15126. may initiate appropriate applications, thus providing a "real-life" tutorial 
  15127. capability for new or inexperienced users. 
  15128.  
  15129. This chapter will describe the use of IPF for creating help libraries and 
  15130. online documents, and examine some ways in which IPF  may improve the 
  15131. ease-of-use of Presentation Manager applications. 
  15132.  
  15133.  
  15134. ΓòÉΓòÉΓòÉ 25.1. Creating Help Information ΓòÉΓòÉΓòÉ
  15135.  
  15136. Help information is created in ASCII source files using an IPF tag language, 
  15137. which embeds formatting tags in the text.  These tags define the formatting 
  15138. characteristics of the text which appears in help windows, and the appearance 
  15139. of the windows themselves.  Once the source files are created, the IPF compiler 
  15140. is then used to translate the source files into an IPF library format.  The IPF 
  15141. compiler can generate a table of contents and an index for help information. 
  15142.  
  15143.  
  15144. ΓòÉΓòÉΓòÉ 25.1.1. IPF Tag Language ΓòÉΓòÉΓòÉ
  15145.  
  15146. The IPF tag language is similar in structure and syntax to the Generalized 
  15147. Markup Language (GML) used by IBM's Document Composition Facility* (DCF*) 
  15148. product.  Source files are simple ASCII text files, and can be created using 
  15149. any normal text editor. 
  15150.  
  15151. Tags are embedded in the files simply by inserting the tag into the text at the 
  15152. required point.  For example, this document was created and formatted using GML 
  15153. tags, and the opening sentences of this chapter were created using the format 
  15154. shown in Figure "IPF Tag Language Example". 
  15155.  
  15156. Note that the chapter heading is preceded by a "header level 1" tag which 
  15157. causes the header text to be formatted in a particular manner.  Similarly, the 
  15158. header is followed by a "paragraph" tag which caused a new paragraph to begin. 
  15159. The formatting of the text within the source file is not significant; there is 
  15160. no requirement for a tag to begin at the left margin, or for each tag to begin 
  15161. on a separate line.  A developer may organize the source files in the most 
  15162. appropriate manner for readability. 
  15163.  
  15164. The first statement in a source file must be a :userdoc tag, and the last 
  15165. statement must be a :euserdoc tag.  These tags are required by IPF.  Comments 
  15166. may also be imbedded within a source file using the :* tag; comments are 
  15167. ignored by the IPF  compiler, and do not appear in the formatted text. 
  15168.  
  15169. A complete description of the formatting tags available under the IPF tag 
  15170. language is beyond the scope of this document.  Some examples are given in the 
  15171. remainder of this chapter, and each tag is described in detail in the IBM OS/2 
  15172. Version 2.0 Information Presentation Reference. 
  15173.  
  15174.  
  15175. ΓòÉΓòÉΓòÉ 25.1.2. Defining Help Panels ΓòÉΓòÉΓòÉ
  15176.  
  15177. The IPF tag language contains "header" tags with levels from 1 to 6; by 
  15178. default, levels 1 to 3 define the start of a new help panel, and are 
  15179. automatically included in the table of contents for online documentation. Each 
  15180. help panel therefore begins with one of these header tags, followed by the help 
  15181. text to be displayed within that panel. 
  15182.  
  15183. Figure "Simple Help Panel Source" 
  15184.  
  15185. The res= attribute specified in the :h1 through :h6 tags is used by IPF to 
  15186. uniquely identify the help panel, and to enable an application to link to that 
  15187. panel when the user requests help.  See Linking Help Windows With Applications 
  15188. for further information. 
  15189.  
  15190. The x=, y=, cx= and cy= attributes define the position and size of the window 
  15191. within its parent.  In the case of a help window, the parent is the application 
  15192. window from which the help window was invoked. 
  15193.  
  15194. The header levels 1 to 3 are used when organizing help panels within the table 
  15195. of contents.  Panels defined with header level 3 are grouped under the last 
  15196. defined header level 2, and those defined with header level 2 are similarly 
  15197. grouped under the last defined header level 1.  Thus the order of definition 
  15198. within the source file is significant. 
  15199.  
  15200. Note that multiple help panels may be placed within a single source file, 
  15201. simply by including additional header tags.  By default, header levels 4 to 6 
  15202. will not cause the display of a new help window, but will appear as formatted 
  15203. subject headings within a help panel. 
  15204.  
  15205.  
  15206. ΓòÉΓòÉΓòÉ 25.1.3. Displaying Graphics ΓòÉΓòÉΓòÉ
  15207.  
  15208. In addition to text information, graphics may also be displayed in help panels. 
  15209. Either character graphics or bitmaps may be used.  Character graphics are 
  15210. embedded directly within the help text, using the :xmp tag to ensure correct 
  15211. formatting.  Bitmaps are referenced from within the help text using the 
  15212. :artwork tag.  An example of this tag is shown in Figure "Displaying a Bitmap 
  15213. in a Help Window". 
  15214.  
  15215. The align= attribute on the :artwork tag allows a bitmap to be aligned either 
  15216. left-justified, right-justified or centered in the window.  In situations where 
  15217. the bitmap must fill the entire window, the fit attribute may be specified, 
  15218. which causes the bitmap to be scaled to fit the window size. 
  15219.  
  15220.  
  15221. ΓòÉΓòÉΓòÉ 25.1.4. Hypertext and Hypergraphics ΓòÉΓòÉΓòÉ
  15222.  
  15223. Help windows may be nested through the use of links embedded within the help 
  15224. information.  Both text and graphics may be defined as selectable; selection of 
  15225. these items can then be used to trigger events such as: 
  15226.  
  15227.  Display of another help window with supporting help text 
  15228.  
  15229.  Dispatch of message to the application window which invoked the help window 
  15230.  
  15231.  Initiation of a new application. 
  15232.  
  15233. Selectable items are known as links; text items are hypertext links, and 
  15234. graphical items are hypergraphic links. Each of these link types is described 
  15235. in the following sections. 
  15236.  
  15237. Hypertext Links 
  15238.  
  15239. Text items are defined using the :link tag, which defines the type of event 
  15240. triggered by the link operation, and details of the target object activated by 
  15241. the link.  An example of a :link tag is shown in Figure "Hypertext Link". 
  15242.  
  15243. The :link tag shown in the example above uses the reftype= attribute to 
  15244. identify the type of event to be triggered (in this case, the display of 
  15245. another help window).  The res= attribute identifies the help window to be 
  15246. displayed when the hypertext item is selected. 
  15247.  
  15248. Different values for the reftype= attribute will trigger different types of 
  15249. events: 
  15250.  
  15251.  Specifying reftype=hd causes the display of another help window, as shown in 
  15252.   Figure "Hypertext Link".  The res= attribute must also be specified in order 
  15253.   to identify the help window to be displayed. 
  15254.  
  15255.  Specifying reftype=fn causes the display of a popup window containing a 
  15256.   footnote.  The refid= attribute must also be specified in order to identify 
  15257.   the footnote. 
  15258.  
  15259.  Specifying reftype=inform causes a message to be sent to the application 
  15260.   window which invoked the help window.  The res= attribute must also be 
  15261.   specified, and its value is passed back to the application. 
  15262.  
  15263.  Specifying reftype=launch causes another application to be started by the 
  15264.   operating system.  The name of the program to be started is specified in the 
  15265.   object= attribute, and parameters may be passed to the program in the data= 
  15266.   attribute. 
  15267.  
  15268. The use of hypertext links provides a powerful means to develop sophisticated 
  15269. help text and online documentation, and to implement tutorials and 
  15270. "self-teaching" applications.  This subject is discussed further in 
  15271. Self-Teaching Applications. 
  15272.  
  15273. Hypergraphic Links 
  15274.  
  15275. Bitmapped graphic items are defined in a slightly different manner to text 
  15276. items, using the :artlink tag.  The :artlink tag is specified on the line 
  15277. immediately following the :artwork tag in the source file. 
  15278.  
  15279. Multiple :artlink tags may be defined for the same bitmap, in order that the 
  15280. user may select different portions of the bitmap to trigger different events. 
  15281. If multiple :artlink tags are specified however, they must be placed in a link 
  15282. file, which is referenced using the linkfile= attribute to the :artwork tag. 
  15283.  
  15284. Both techniques are illustrated in Figure "Hypergraphic Link". 
  15285.  
  15286. The use of a link file is mandatory where multiple hypergraphic links exist for 
  15287. the same bitmap.  The format of a link file is shown in Figure "Link File With 
  15288. Multiple Hypergraphic Links". 
  15289.  
  15290. Multiple :link tags are nested within a single :artlink tag, and define various 
  15291. selectable areas of the bitmap, each of which triggers a specific event when 
  15292. selected by the user.  Any of the types of events normally triggered by a :link 
  15293. tag may be initiated from a hypergraphic link. 
  15294.  
  15295.  
  15296. ΓòÉΓòÉΓòÉ 25.1.5. Viewports ΓòÉΓòÉΓòÉ
  15297.  
  15298. Information within help windows is displayed in viewports. In the default case, 
  15299. a single viewport is defined that occupies the entire help window and contains 
  15300. the text.  This is known as a simple viewport. However, multiple viewports may 
  15301. be defined within the same help window, and handled separately.  For example, 
  15302. two viewports may be defined in a help window;  the first may be used to 
  15303. display a graphical diagram, while the second may contain a text narrative 
  15304. relating to the diagram.  The user may scroll the text in the window, but the 
  15305. diagram remains displayed since it lies in a separate viewport.  This type of 
  15306. definition is known as a complex viewport. 
  15307.  
  15308. Multiple viewports are normally defined within a help window using :link tags 
  15309. which are known as automatic links.  These operate in a similar manner to 
  15310. hypertext links, but are invoked automatically when the help window is 
  15311. displayed.  An example of a help window containing such links is shown in 
  15312. Figure "Multiple Viewports Using Automatic Links". 
  15313.  
  15314. The auto attribute specifies that the viewport is to be opened automatically 
  15315. when its parent help window is opened.  The dependent attribute specifies that 
  15316. the viewport is to be closed when its parent is closed.  The vpx=, vpy=, vpcx= 
  15317. and vpcy= attributes specify the position and size of the viewport within the 
  15318. parent window.  In Figure "Multiple Viewports Using Automatic Links", two 
  15319. viewports are opened, positioned side-by-side within the parent window. 
  15320.  
  15321. The scroll=, titlebar= and rules= attributes determine whether each viewport 
  15322. possesses its own scroll bars, title bar and sizing borders.  In Figure 
  15323. "Multiple Viewports Using Automatic Links", neither viewport contains a title 
  15324. bar or sizing border (both make use of the parent's title bar and border), but 
  15325. the right-hand viewport contains its own scroll bar.  This allows the 
  15326. right-hand viewport to be scrolled while the left-hand viewport remains 
  15327. unchanged. 
  15328.  
  15329. IPF-Controlled Viewports 
  15330.  
  15331. By default, the presentation of information in viewports is under the control 
  15332. of IPF, using instructions defined in the source files.  Such viewports are 
  15333. known as IPF-controlled viewports. When an IPF-controlled viewport is used, 
  15334. text is automatically formatted within the viewport by IPF, and presented in 
  15335. the help window. 
  15336.  
  15337. Application-Controlled Viewports 
  15338.  
  15339. A viewport may also be defined as an application-controlled viewport, using the 
  15340. :acviewport tag.  This tag allows an application to take direct control of a 
  15341. viewport, and to present information in this viewport in a manner determined by 
  15342. that application.  For example, a full-motion video application could be used 
  15343. to display information in video format. 
  15344.  
  15345. The :acviewport tag is shown in Figure "Application-Controlled Viewport". 
  15346.  
  15347. The :acviewport tag causes IPF to load a dynamic link library as specified in 
  15348. the dll= attribute, and to pass control to the entry point identified by the 
  15349. objectname= attribute. 
  15350.  
  15351.  
  15352. ΓòÉΓòÉΓòÉ 25.2. Compiling Source Files ΓòÉΓòÉΓòÉ
  15353.  
  15354. Once the text has been generated in source files, it must be compiled in order 
  15355. to produce a help library.  By default, source files have an extension of IPF. 
  15356. The IPF compiler does not require this extension, but if the compiler finds two 
  15357. files with the same name, the file with the IPF extension is used in the 
  15358. compilation. 
  15359.  
  15360. For source files that will be used to produce online documents rather than help 
  15361. libraries, the extension INF should be used.  See Stand-Alone Online 
  15362. Documentation for further information. 
  15363.  
  15364.  
  15365. ΓòÉΓòÉΓòÉ 25.2.1. The IPFC Command ΓòÉΓòÉΓòÉ
  15366.  
  15367. The IPF compiler is invoked using the IPFC command, as follows: 
  15368.  
  15369. IPFC SOURCE.IPF /X /W3 >ERRORS.TXT
  15370.  
  15371. The above command invokes the IPF compiler with the input file SOURCE.IPF.  The 
  15372. /X parameter instructs the compiler to produce a cross-reference listing for 
  15373. all headings, diagrams, etc.  The /Wn command specifies the level of 
  15374. error-reporting to be performed; valid levels are 1 (/W1) to 3 (/W3).  The 
  15375. final parameter pipes any error messages to the file ERRORS.TXT in order that 
  15376. they may be examined later.  The IPFC command is fully documented in the IBM 
  15377. OS/2 Version 2.0 Information Presentation Reference. 
  15378.  
  15379. When creating online documentation that will function in a stand-alone format 
  15380. rather than as help associated with an application, the /INF parameter is 
  15381. specified.  This causes the IPF compiler to search for source files with the 
  15382. INF extension, and to format the output for use with the online viewing utility 
  15383. VIEW.EXE. 
  15384.  
  15385.  
  15386. ΓòÉΓòÉΓòÉ 25.2.2. National Language Support ΓòÉΓòÉΓòÉ
  15387.  
  15388. Support for languages other than U.S. English may be provided in help files by 
  15389. specifying the /COUNTRY, /CODEPAGE and /LANGUAGE parameters in the IPFC 
  15390. command.  These parameters affect the collating sequence used when creating a 
  15391. table of contents or index, and the titles displayed for note (:nt), warning 
  15392. (:warning) and caution (:caution) tags. 
  15393.  
  15394. These parameters and the use of national languages in help windows and online 
  15395. documentation is described in more detail in the IBM OS/2 Version 2.0 
  15396. Information Presentation Reference. 
  15397.  
  15398.  
  15399. ΓòÉΓòÉΓòÉ 25.3. Linking Help Windows With Applications ΓòÉΓòÉΓòÉ
  15400.  
  15401. In order for an application to display help information using IPF, a number of 
  15402. steps must be performed to link the application's windows with the 
  15403. corresponding help windows.  Each of these steps is described in the following 
  15404. sections. 
  15405.  
  15406.  
  15407. ΓòÉΓòÉΓòÉ 25.3.1. Creating a Help Table ΓòÉΓòÉΓòÉ
  15408.  
  15409. A help table is a Presentation Manager resource, and is defined in a resource 
  15410. script file using the HELPTABLE resource.  An example of a help table is shown 
  15411. in Figure "Help Table Resource Definition". 
  15412.  
  15413. The HELPITEM resources within the help table define each application window for 
  15414. which help is to be provided, and point to a HELPSUBTABLE resource. Each 
  15415. HELPITEM resource also defines the panel identifier of the optional extended 
  15416. help panel for that window. 
  15417.  
  15418. A HELPSUBTABLE resource is defined for each window, and contains HELPSUBITEM 
  15419. resources that identify each item within the window for which help is to be 
  15420. provided, and the panel identifier of the help panel for that item. 
  15421.  
  15422. For example, Figure "Help Table Resource Definition" shows a main window with 
  15423. the window identifier MAIN, and a dialog box with the identifier DIALOG1.  A 
  15424. subtable is defined for MAIN, which defines the menu bar items within that 
  15425. window, and identifies a help panel for each of these items.  For DIALOG1, the 
  15426. subtable specifies the identifiers of the control windows within the dialog 
  15427. box, and identifies a help panel for each control window.  The identifiers of 
  15428. the help panels must correspond to the identifiers specified in the res= 
  15429. attribute of the header tags. 
  15430.  
  15431.  
  15432. ΓòÉΓòÉΓòÉ 25.3.2. Creating a Help Instance ΓòÉΓòÉΓòÉ
  15433.  
  15434. Once the help table for an application has been created, the application must 
  15435. pass this help table to IPF and create a help instance, using the 
  15436. WinCreateHelpInstance() function.  This function is shown in Figure 
  15437. "WinCreateHelpInstance() Function". 
  15438.  
  15439. The WinCreateHelpInstance() function is normally called from an application's 
  15440. main routine, immediately after creating the application's main window, but 
  15441. before entering the message processing loop. 
  15442.  
  15443. The WinCreateHelpInstance() function creates the application's main help 
  15444. window, which is initially invisible, and passes appropriate information to 
  15445. that window to enable the specified help library to be loaded and access to be 
  15446. obtained to required resources.  See Main Help Window. 
  15447.  
  15448.  
  15449. ΓòÉΓòÉΓòÉ 25.3.3. Associating a Help Instance ΓòÉΓòÉΓòÉ
  15450.  
  15451. Once the help instance has been created, it must be associated with an 
  15452. application window.  The help instance is normally associated with the 
  15453. application's main frame window, and help may therefore be provided for any 
  15454. children of the frame window, including the menu bar and client window.  The 
  15455. WinAssociateHelpInstance() function is used to associate a help instance with 
  15456. an application window; an example of this function is shown in Figure 
  15457. "WinAssociateHelpInstance() Function". 
  15458.  
  15459. The WinAssociateHelpInstance() function is normally called from the 
  15460. application's main routine, immediately following the WinCreateHelpInstance() 
  15461. function call. 
  15462.  
  15463.  
  15464. ΓòÉΓòÉΓòÉ 25.3.4. Ending a Help Instance ΓòÉΓòÉΓòÉ
  15465.  
  15466. Upon termination of the application, the help instance should be ended using a 
  15467. WinDestroyHelpInstance() function call, as shown in Figure 
  15468. "WinDestroyHelpInstance() Function". 
  15469.  
  15470. This function is invoked immediately after termination of the application's 
  15471. message processing routine, and prior to destroying the application's main 
  15472. window. 
  15473.  
  15474.  
  15475. ΓòÉΓòÉΓòÉ 25.4. Displaying Help Panels ΓòÉΓòÉΓòÉ
  15476.  
  15477. Help panels are displayed in help windows by IPF as a result of user 
  15478. interaction.  A user may cause a help panel to be displayed in one of three 
  15479. ways: 
  15480.  
  15481.  Hitting the F1 key 
  15482.  
  15483.  Selecting a "Help" item on the menu bar or a pulldown menu 
  15484.  
  15485.  Pressing a Help pushbutton in a dialog box. 
  15486.  
  15487. Each of these actions normally results in a WM_HELP message being generated. 
  15488. This message is trapped by IPF, which then determines the active application 
  15489. window and uses the current help table to identify the help panel for that 
  15490. window. 
  15491.  
  15492.  
  15493. ΓòÉΓòÉΓòÉ 25.4.1. F1 Key ΓòÉΓòÉΓòÉ
  15494.  
  15495. Under the default accelerator table maintained by Presentation Manager for all 
  15496. windows, the F1 key causes a WM_HELP message to be generated and posted to the 
  15497. queue for the window that possessed the input focus when the key was pressed. 
  15498. Explicit definition of the accelerator key by the application is not required. 
  15499.  
  15500.  
  15501. ΓòÉΓòÉΓòÉ 25.4.2. Help Menu Bar Item ΓòÉΓòÉΓòÉ
  15502.  
  15503. A "Help" menu bar item, whether it is defined on the menu bar or in a "Help" 
  15504. pulldown menu, should be defined using the MIS_HELP style.  This will cause the 
  15505. item to generate a WM_HELP message, rather than a WM_COMMAND message.  The 
  15506. definition of such an item is shown in Figure "Resource Script File". 
  15507.  
  15508.  
  15509. ΓòÉΓòÉΓòÉ 25.4.3. Help Pushbutton ΓòÉΓòÉΓòÉ
  15510.  
  15511. A "Help" pushbutton in a dialog box should be defined using the BS_HELP and 
  15512. BS_NOPOINTERFOCUS styles.  The WM_HELP message is passed to IPF, which then 
  15513. determines the control window within the dialog box that currently possesses 
  15514. the input focus, and displays the help panel for that control window. 
  15515.  
  15516.  
  15517. ΓòÉΓòÉΓòÉ 25.5. Main Help Window ΓòÉΓòÉΓòÉ
  15518.  
  15519. The WinCreateHelpInstance() function returns a window handle.  This is the 
  15520. handle of the application's main help window.  The main help window is created 
  15521. by IPF, with a standard format and with a window procedure supplied by 
  15522. Presentation Manager.  Whenever a help panel is displayed, it appears as a 
  15523. child window of the main help window. 
  15524.  
  15525. The main help window has a title bar, which contains a title specified by the 
  15526. application.  The application passes this title in the pszHelpWindowTitle 
  15527. parameter to the WinCreateHelpInstance() function. 
  15528.  
  15529. The main help window contains a menu bar with several pulldown menus allowing 
  15530. the user to perform text searches, view the index, etc.  An application 
  15531. developer may modify this menu bar using the resource definitions contained in 
  15532. the hmtailor.rc file provided with IPF.  This file includes an hmtailor.h file, 
  15533. which contains the integer constant definitions for the menu bar and pulldown 
  15534. menu items.  Additional items may be defined within the help pulldown menu, but 
  15535. their resource identifiers should be between 7F00 and 7FFF to avoid conflicts 
  15536. with identifiers already defined. 
  15537.  
  15538. When the menu bar of the main help window has been modified, it must be 
  15539. resource-compiled in the normal way, and combined with the application's 
  15540. executable file or with a DLL.  Its resource identifier must then be specified 
  15541. in the idActionBar parameter of the WinCreateHelpInstance() function call.  If 
  15542. additional accelerator keys have been defined, the identifier of the 
  15543. accelerator table must also be defined in the idAccelTable parameter. 
  15544.  
  15545. If the menu bar and accelerator table definitions have been combined with a 
  15546. DLL, the module handle of this DLL must be specified in the 
  15547. hmodAccellActionBarModule parameter.  The module handle must first be obtained 
  15548. using the DosLoadModule() or DosGetModuleHandle() functions.  These functions 
  15549. are described in Loading Resources From a DLL. 
  15550.  
  15551.  
  15552. ΓòÉΓòÉΓòÉ 25.5.1. The Help Pulldown Menu ΓòÉΓòÉΓòÉ
  15553.  
  15554. The menu bar of the main help window contains a "Help" pulldown menu which in 
  15555. turn contains a number of options.  The resource definition for this pulldown 
  15556. menu is included in the hmtailor.rc file provided with IPF, and illustrated in 
  15557. Figure "Help Pulldown Menu Definition". 
  15558.  
  15559. When the user selects an item from the help pulldown menu, a message is 
  15560. generated, and is trapped by IPF and processed.  Typically, this message causes 
  15561. IPF to query the application for the correct help panel.  The message generated 
  15562. is dependent upon the pulldown menu item selected by the user. 
  15563.  
  15564. Help For Help 
  15565.  
  15566. When the user selects this item, IPF sends a WM_COMMAND message to the active 
  15567. application window, with the first parameter containing the ID_HELP_FOR_HELP 
  15568. identifier.  The application's window procedure should process this message by 
  15569. sending an HM_REPLACE_HELP_FOR_HELP message containing the panel identifier of 
  15570. its own "Help for help" panel if one exists, or by sending an HM_DISPLAY_PANEL 
  15571. message with both parameters set to zero in order to display the default panel. 
  15572.  
  15573. Extended Help 
  15574.  
  15575. When the user selects this item, IPF responds by displaying the "Extended help" 
  15576. panel defined for the active application window in the help table.  If no such 
  15577. help panel is defined for that window, IPF sends an HM_EXT_HELP_UNDEFINED 
  15578. message to the application (see Communication Between IPF and Applications 
  15579. (HM_EXT_HELP_UNDEFINED)). 
  15580.  
  15581. Keys Help 
  15582.  
  15583. When the user selects this item, IPF sends an HM_QUERY_KEYS_HELP message to the 
  15584. active application window.  The application's window procedure should process 
  15585. this message by returning the panel identifier of its own "Keys help" panel in 
  15586. the return code to Presentation Manager. 
  15587.  
  15588. Help Index 
  15589.  
  15590. Selecting this item causes IPF to display the index of the current help 
  15591. library. 
  15592.  
  15593.  
  15594. ΓòÉΓòÉΓòÉ 25.5.2. Communication Between IPF and Applications ΓòÉΓòÉΓòÉ
  15595.  
  15596. Information may be communicated from IPF to an application in response to user 
  15597. interaction in a help window.  This information may be in the form of 
  15598. application events or errors, and is communicated to the application in the 
  15599. form of a message passed to the application window specified in the 
  15600. WinCreateHelpInstance() function.  Such messages originate from the main help 
  15601. window, as part of the window procedure supplied by Presentation Manager for 
  15602. that window. 
  15603.  
  15604. HM_INFORM Message 
  15605.  
  15606. This message is passed to the application when the user selects a hypertext or 
  15607. hypergraphic item in a help window, for which the reftype=inform attribute has 
  15608. been specified.  The first parameter of the HM_INFORM message contains the 
  15609. identifier specified by the res= attribute in the hypertext or hypergraphic 
  15610. link definition. 
  15611.  
  15612. An application window typically processes the HM_INFORM message by examining 
  15613. the identifier in the first message parameter, and dispatching a message of the 
  15614. appropriate class to itself or another application window, in order to initiate 
  15615. the action requested by the HM_INFORM message. 
  15616.  
  15617. HM_ERROR 
  15618.  
  15619. This message is passed to the application when an error occurs during a user 
  15620. interaction with a help window.  This message allows the application to display 
  15621. its own error message in such cases, thereby providing a consistent appearance 
  15622. for error messages.  The first parameter of the message indicates the reason 
  15623. for the error.  These reasons are documented in the IBM OS/2 Version 2.0 
  15624. Information Presentation Reference. 
  15625.  
  15626. An application typically processes the HM_ERROR message by displaying an 
  15627. appropriate message box and returning zero to Presentation Manager.  If the 
  15628. application does not process the message, Presentation Manager takes no action. 
  15629.  
  15630. HM_EXT_HELP_UNDEFINED 
  15631.  
  15632. This message indicates that the user selected the "Extended help" item on the 
  15633. "Help" pulldown menu, and that no such help panel was defined for the active 
  15634. application window. 
  15635.  
  15636. An application may process this message in one of three ways: 
  15637.  
  15638.  Display a message box indicating that no help is available 
  15639.  
  15640.  Display its own help window by explicitly creating and displaying the window 
  15641.   on the screen 
  15642.  
  15643.  Pass a HM_DISPLAY_HELP message back to IPF, instructing IPF to display a 
  15644.   particular help panel. 
  15645.  
  15646. If the application does not process this message, no panel is displayed and the 
  15647. user's request is simply ignored. 
  15648.  
  15649. HM_SUBITEM_NOT_FOUND 
  15650.  
  15651. This message indicates that the user issued a help request on an item for which 
  15652. no help panel is defined in the current help table.  The application may 
  15653. process this message in one of three ways, as described in 
  15654. HM_EXT_HELP_UNDEFINED above. The application should then return TRUE to 
  15655. Presentation Manager. 
  15656.  
  15657. If the application does not process this message, the extended help panel for 
  15658. the currently active window is displayed by IPF. 
  15659.  
  15660.  
  15661. ΓòÉΓòÉΓòÉ 25.6. Stand-Alone Online Documentation ΓòÉΓòÉΓòÉ
  15662.  
  15663. Panels containing text produced using IPF need not be called from an 
  15664. application; IPF can be used to produce "stand-alone" online documentation, 
  15665. which is viewed using the VIEW.EXE utility provided with OS/2 Version 2.0. 
  15666. Online documents have similar capabilities to help libraries; both text and 
  15667. graphics may be included, and hypertext and hypergraphic links are supported. 
  15668.  
  15669. Online documents also have a number of differences from help libraries: 
  15670.  
  15671.  In an online document, a panel may be identified by using the name= or id= 
  15672.   attributes in the heading, rather than the res= attribute.  These attributes 
  15673.   allow the use of alphanumeric characters, where the res= attribute must 
  15674.   specify an integer identifier.  Links are then defined using the refid= 
  15675.   attribute in the :link tag. 
  15676.  
  15677.   Note that the name= or id= attributes may not be used if files will be 
  15678.   concatenated and hypertext or hypergraphic links are required between files. 
  15679.  
  15680.  Online documents may not use hypertext or hypergraphic links with 
  15681.   reftype=inform, since there is no associated application for the help 
  15682.   instance, and IPF cannot determine the window to which the message should be 
  15683.   directed. 
  15684.  
  15685.  An online document has a main window created by IPF, which contains the table 
  15686.   of contents for the document.  The title of this main window is determined by 
  15687.   a :title tag. 
  15688.  
  15689.   Note that the :title tag may only be used for online documents, and not for 
  15690.   help libraries.  The title of an application's main help window is specified 
  15691.   in the WinCreateHelpInstance() function call. 
  15692.  
  15693. The ability to include hypertext and hypergraphics in online documents allows 
  15694. the creation of online procedure manuals that automatically invoke the 
  15695. appropriate application or applications for each step of the procedure. This is 
  15696. achieved by defining the hypertext or hypergraphic items with reftype=launch, 
  15697. specifying the name of the executable file for the required application.  See 
  15698. Self-Teaching Applications for further discussion of such applications. 
  15699.  
  15700.  
  15701. ΓòÉΓòÉΓòÉ 25.6.1. Compiling Online Documents ΓòÉΓòÉΓòÉ
  15702.  
  15703. Source files that will be used for online documents are created in an identical 
  15704. manner to those used for help text.  When the IPFC command is invoked to 
  15705. compile the source files, the /INF parameter should be specified, as follows: 
  15706.  
  15707. IPFC SOURCE.IPF /X /W3 /INF >ERRORS.TXT
  15708.  
  15709. The IPF compiler will then include the necessary hooks to enable VIEW.EXE to 
  15710. display the online document.  Note that online documents compiled with the /INF 
  15711. parameter have a default extension of .INF, rather than the normal extension of 
  15712. .HLP for help libraries. 
  15713.  
  15714.  
  15715. ΓòÉΓòÉΓòÉ 25.6.2. Concatenating Source Files ΓòÉΓòÉΓòÉ
  15716.  
  15717. Multiple document files may be concatenated to produce a single online 
  15718. document.  Concatenation is achieved by creating an OS/2 environment variable 
  15719. that contains the names of the concatenated files.  For example: 
  15720.  
  15721. SET BIGDOC=DOC1.INF+DOC2.INF+DOC3.INF+DOC4.INF
  15722.  
  15723. This environment variable is typically set from within a batch file, which also 
  15724. contains the command VIEW BIGDOC to view the resulting concatenated document. 
  15725.  
  15726. Hypertext links are permitted between panels in different files, but a panel 
  15727. must use the res= attribute in the heading tag to identify itself, rather than 
  15728. the name= or id= attributes.  The global attribute must also be specified in 
  15729. the panel heading. 
  15730.  
  15731.  
  15732. ΓòÉΓòÉΓòÉ 25.7. Application Tutorials ΓòÉΓòÉΓòÉ
  15733.  
  15734. For any application, the developer or developers may supply a tutorial, which 
  15735. is effectively another Presentation Manager program which provides step-by-step 
  15736. guidance to the user.  IPF enables tutorials to be started from within help 
  15737. windows, in a number of ways: 
  15738.  
  15739.  Within a help panel, a hypertext or hypergraphic link may be defined with 
  15740.   reftype=launch, and with the objectname= attribute specifying the name of the 
  15741.   tutorial program.  When the user selects the hypertext or hypergraphic item, 
  15742.   the tutorial is started automatically. 
  15743.  
  15744.  A "Tutorial" item may be included in the "Help" pulldown menu in the 
  15745.   application's main help window.  This is done automatically by IPF if any 
  15746.   help panel heading tag (:h1 through :h6) contains the tutorial attribute. 
  15747.  
  15748.   In this case, the name of a tutorial program must be specified in the 
  15749.   pszTutorialName parameter of the WinCreateHelpInstance() function call. 
  15750.  
  15751. When the user selects the "Tutorial" item from the "Help" pulldown menu, an 
  15752. HM_TUTORIAL message is sent to the active application window, with the first 
  15753. parameter containing the name of the tutorial program.  The application 
  15754. typically processes this message by calling the DosExecPgm() function to start 
  15755. the tutorial program. 
  15756.  
  15757.  
  15758. ΓòÉΓòÉΓòÉ 25.8. Self-Teaching Applications ΓòÉΓòÉΓòÉ
  15759.  
  15760. An extension of the tutorial concept is possible, where the user invokes an 
  15761. online procedure manual that describes a business process; hypertext and 
  15762. hypergraphic links can be imbedded in this manual to start the application or 
  15763. applications that support the business process.  This can be performed in 
  15764. either of two ways: 
  15765.  
  15766.  Where the steps in the business process are largely independent of one 
  15767.   another, a separate application may be used for each step. 
  15768.  
  15769.  Where the steps are interdependent, a single application can be used, with 
  15770.   links triggering application events by way of messages. 
  15771.  
  15772. Note that this is an extension of the procedural entity concept originally 
  15773. discussed in Object-Oriented Applications. 
  15774.  
  15775.  
  15776. ΓòÉΓòÉΓòÉ 25.8.1. Loosely Coupled Applications ΓòÉΓòÉΓòÉ
  15777.  
  15778. Where the steps in a business process are independent of one another and do not 
  15779. require any great coordination between supporting application functions, 
  15780. separate programs may be used to carry out each step.  In this case, the 
  15781. procedure manual is created as an online document with links for each step. 
  15782. Each link is specified with reftype=launch. 
  15783.  
  15784.  
  15785. ΓòÉΓòÉΓòÉ 25.8.2. Tightly Coupled Applications ΓòÉΓòÉΓòÉ
  15786.  
  15787. Where interdependencies exist between the steps in a business process, and 
  15788. where the application functions that support these steps must therefore 
  15789. interact closely with one another, a single application is used.  In this case, 
  15790. the procedure manual is created as a help library, and execution is handled as 
  15791. follows: 
  15792.  
  15793.  1. The application creates a help instance for the help library in the normal 
  15794.     manner, creates its own main window but does not make this window visible. 
  15795.  
  15796.  2. The application's main window makes itself the active window, and sends an 
  15797.     HM_DISPLAY_HELP message to the main help window to cause the initial help 
  15798.     panel to be displayed. 
  15799.  
  15800.  3. Each step in the business is defined using hypertext or hypergraphic links 
  15801.     with reftype=inform.  When such an item is selected, it causes an HM_INFORM 
  15802.     message to be posted to the application's main window (the active window). 
  15803.  
  15804.  4. When the application's main window receives the HM_INFORM message, it 
  15805.     examines the message parameters to determine the required action, then 
  15806.     creates one or more additional display windows or dialog boxes and makes 
  15807.     these visible, allowing the user to complete the required step. 
  15808.  
  15809.  5. When the current step is complete, the user selects an appropriate menu bar 
  15810.     item or pushbutton, and returns to the procedure manual. 
  15811.  
  15812. Using this technique, the application's main window retains overall control of 
  15813. the application, and can ensure coordination between steps and impose a 
  15814. sequence of execution if this is required. 
  15815.  
  15816.  
  15817. ΓòÉΓòÉΓòÉ 25.9. Summary ΓòÉΓòÉΓòÉ
  15818.  
  15819. The Information Presentation Facility allows an application developer to create 
  15820. online context-sensitive help panels and stand-alone online documentation for 
  15821. Presentation Manager applications.  The ability to link between panels and 
  15822. between a panel and applications provides a flexible and powerful tool for 
  15823. developing: 
  15824.  
  15825.  Presentation Manager applications that contain comprehensive help information 
  15826.  
  15827.  Online manuals both for applications and for business processes 
  15828.  
  15829.  Interactive tutorials for applications and business processes 
  15830.  
  15831.  "Self-teaching" business processes where the online manual automatically 
  15832.   starts the required applications and leads the novice user through the 
  15833.   process. 
  15834.  
  15835. The flexibility of IPF and the high level of interaction between a help 
  15836. instance and its controlling application allows the application to exercise 
  15837. significant control over the way in which help information is displayed to the 
  15838. end user.  The ability to combine multiple viewports in a single help window 
  15839. allows the simultaneous use of text, graphics and other technologies such as 
  15840. image or full-motion video to provide help, documentation and tutorial 
  15841. information. 
  15842.  
  15843.  
  15844. ΓòÉΓòÉΓòÉ 26. Problem Determination ΓòÉΓòÉΓòÉ
  15845.  
  15846. The steps required for identification and resolution of application errors and 
  15847. "bugs" in the Presentation Manager application environment are basically 
  15848. similar to those required for conventional programming environments.  However, 
  15849. the event-driven nature of the Presentation Manager application model often 
  15850. causes unnecessary confusion when developers attempt to test and debug their 
  15851. applications.  This chapter describes a simple approach to problem 
  15852. determination and resolution under Presentation Manager, which will help in 
  15853. locating and removing the majority of application problems. 
  15854.  
  15855. Successful problem determination in the Presentation Manager environment, as in 
  15856. any programming environment, requires some basic ingredients: 
  15857.  
  15858.  Effective problem documentation 
  15859.  
  15860.  A methodical approach to problem resolution 
  15861.  
  15862.  Knowledge and experience of the application environment 
  15863.  
  15864.  A symbolic debugging tool such as CodeView or Multiscope** 
  15865.  
  15866.  A measure of luck (!) 
  15867.  
  15868. When these requirements are satisfied, problem determination may proceed 
  15869. through the following three phases: 
  15870.  
  15871.  1. Documentation 
  15872.  
  15873.  2. Isolation 
  15874.  
  15875.  3. Diagnosis and resolution. 
  15876.  
  15877. The remainder of this chapter describes each of these phases in detail, 
  15878. discussing each step in the resolution process, and also describes the symptoms 
  15879. and likely solutions for some common application problems. 
  15880.  
  15881.  
  15882. ΓòÉΓòÉΓòÉ 26.1. Problem Documentation ΓòÉΓòÉΓòÉ
  15883.  
  15884. Problems in Presentation Manager applications typically occur within window 
  15885. procedures, or in subroutines invoked from within window procedures.  This is 
  15886. not surprising, since all processing within a Presentation Manager application 
  15887. takes place as a result of messages, which are received and processed by window 
  15888. procedures.  However, the event-driven nature of the Presentation Manager 
  15889. application model provides a built-in means of narrowing down the location of a 
  15890. problem, provided the event that caused the problem can be determined. 
  15891.  
  15892. The initial documentation of an error may be performed by whoever is 
  15893. responsible for application testing, since no great level of technical 
  15894. expertise is required at this stage.  It is important that the error is 
  15895. effectively documented in writing, at the time it occurs, along with relevant 
  15896. supporting information.  Effective documentation greatly eases the task of 
  15897. recreating the error and identifying the underlying problem. 
  15898.  
  15899. A worksheet that may be used for problem documentation, and that records the 
  15900. information required by the guidelines given in this chapter, is contained in 
  15901. Problem Reporting Worksheet. 
  15902.  
  15903.  
  15904. ΓòÉΓòÉΓòÉ 26.1.1. Window ΓòÉΓòÉΓòÉ
  15905.  
  15906. In order to narrow down the location of the problem, it is first necessary to 
  15907. identify the window that was active when the error occurred.  This is usually 
  15908. self-evident when the window is a display window, but may be less so if the 
  15909. window is an object window.  However, an object window is activated upon 
  15910. receiving a message that typically originates from a display window, and 
  15911. therefore the problem may be effectively tracked down by beginning the search 
  15912. with the display window. 
  15913.  
  15914. The first step is therefore to determine the display window with which the user 
  15915. was interacting when the error occurred.  For documentation purposes, the 
  15916. window's title may be used to identify the window. 
  15917.  
  15918. Step #1:  Identify the window with which the user was interacting when the 
  15919.           error occurred, and note its title. 
  15920.  
  15921. Identification of the active window allows the search for the problem to be 
  15922. focused on the window procedure for that window.  It is likely that the problem 
  15923. lies within that window procedure or a subroutine invoked from that window 
  15924. procedure.  If not, the active window usually passes a message to another 
  15925. window which in turn causes the problem; this may be determined in the 
  15926. isolation phase (see Problem Isolation). 
  15927.  
  15928.  
  15929. ΓòÉΓòÉΓòÉ 26.1.2. Event/Action ΓòÉΓòÉΓòÉ
  15930.  
  15931. Once the active window has been identified, it is necessary to determine the 
  15932. last user action before the error occurred.  The name of the last menu bar or 
  15933. pulldown menu item, button or icon selected should be noted for documentation 
  15934. of the problem. 
  15935.  
  15936. Step #2:  Identify the last user action before the error occurred, and record 
  15937.           the name of the menu bar or pulldown menu item, button or icon. 
  15938.  
  15939. Identification of the last user action provides the initial location, within 
  15940. the window procedure for the active window, at which to begin searching for the 
  15941. problem.  The problem is likely to be within the scope of processing for the 
  15942. message resulting from this action, or within that of another message generated 
  15943. during the processing of this action. 
  15944.  
  15945.  
  15946. ΓòÉΓòÉΓòÉ 26.1.3. First Time vs Repetitive Actions ΓòÉΓòÉΓòÉ
  15947.  
  15948. The third important step in documenting a problem is to determine whether the 
  15949. error occurs every time a particular action is performed, or if it only occurs 
  15950. after the action has been performed a number of times. 
  15951.  
  15952. Step #3:  Note whether the problem occurred when the action was performed for 
  15953.           the first time, or only when the action had been repeated a number of 
  15954.           times. 
  15955.  
  15956. Problems that occur after a number of repetitions of an action typically 
  15957. indicate a resource limitation being exceeded, and provide a short-cut to 
  15958. problem resolution; see Repetitive Action Problems. 
  15959.  
  15960.  
  15961. ΓòÉΓòÉΓòÉ 26.2. Problem Isolation ΓòÉΓòÉΓòÉ
  15962.  
  15963. Once the problem has been documented and narrowed down to a specific event 
  15964. within a particular window, the developer must determine the Presentation 
  15965. Manager message that results from that event, or the first such message if 
  15966. multiple messages are generated. 
  15967.  
  15968. A symbolic debugging tool is then applied to the application code, and a 
  15969. breakpoint is set at the commencement of processing for that message class. The 
  15970. program is then single-stepped to determine the operation or function call at 
  15971. which the error occurs. 
  15972.  
  15973. Step #4:  Single-step with a symbolic debugging tool to determine the code 
  15974.           statement at which the error occurs. 
  15975.  
  15976. It is important during this stage to note any WinPostMsg(), WinSendMsg() or 
  15977. WinBroadcastMsg() function calls performed by the program, which will generate 
  15978. additional Presentation Manager messages in the system.  If the initial pass 
  15979. through the processing for the current message does not reveal the error, the 
  15980. same process must be performed for each of these messages and the window 
  15981. procedures that process them. 
  15982.  
  15983. Note that this single-stepping process is most useful in situations where the 
  15984. error occurs every time a particular action is performed.  In cases where the 
  15985. error only appears after a large number of repetitions, single-stepping will be 
  15986. time-consuming and unproductive.  In such cases, the problem resolution process 
  15987. may be expedited by omitting the isolation phase and immediately checking the 
  15988. logic of the processing for the failing message, to ensure that all resources 
  15989. allocated during processing are subsequently released.  See Repetitive Action 
  15990. Problems for more details. 
  15991.  
  15992.  
  15993. ΓòÉΓòÉΓòÉ 26.3. Problem Diagnosis ΓòÉΓòÉΓòÉ
  15994.  
  15995. Once the cause of the error is narrowed down to a single statement within the 
  15996. source code, the problem with that statement must then be identified. 
  15997. Syntactical errors can generally be ruled out as a cause of failure during run 
  15998. time, since such errors are almost always identified during compilation of the 
  15999. application code.  However, the items listed below are common causes of 
  16000. run-time errors, and should be checked for failing program statements: 
  16001.  
  16002.  Logic:  is the sequence of operations performed during the processing of a 
  16003.   message in accordance with the application design?  Have any steps been 
  16004.   accidentally omitted? 
  16005.  
  16006.  Parameters:  are the correct variable names being used for parameters in the 
  16007.   program statement?  Do the parameter definitions in the program statement 
  16008.   directly match those given in the function declaration? 
  16009.  
  16010.  Pointers:  do they contain valid references, and/or have they been correctly 
  16011.   initialized prior to the program statement? 
  16012.  
  16013.  Operating system or Presentation Manager resources:  have they been 
  16014.   successfully allocated prior to the program statement?  Are resources 
  16015.   released at the completion of processing for the event and if not, is there a 
  16016.   valid reason for retaining them? 
  16017.  
  16018. Step #5:  Diagnose the cause of the problem by carefully checking the program 
  16019.           statement, and correct the error. 
  16020.  
  16021. The following sections provide descriptions of some common application problems 
  16022. against which failing programs may be checked. 
  16023.  
  16024.  
  16025. ΓòÉΓòÉΓòÉ 26.3.1. First Time Problems ΓòÉΓòÉΓòÉ
  16026.  
  16027. Problems that occur whenever a program statement is executed indicate an error 
  16028. in that statement or in a parameter used by that statement.  These errors may 
  16029. often be indicated by the nature of the error.  Some common errors are given 
  16030. below. 
  16031.  
  16032. Trap 000D 
  16033.  
  16034. This error indicates that the program attempted to access a location in memory 
  16035. that was not within the area allocated to its parent process.  Since such 
  16036. access might violate the integrity of other applications or of the operating 
  16037. system itself, OS/2 disallows the access.  Note that the pointer may directly 
  16038. reference a memory location, or may be the handle to a resource such as a 
  16039. window, presentation space etc. 
  16040.  
  16041. The usual cause of such an error is that a pointer passed as a parameter in a 
  16042. function call is incorrect.  The pointer may not have been initialized, or may 
  16043. have been set to an incorrect value as a result of a failed allocation request 
  16044. or incorrect pointer arithmetic. 
  16045.  
  16046. Resolution actions are typically as follows: 
  16047.  
  16048.  Check that the function call which allocated the resource referenced by the 
  16049.   pointer completed without error, and that a valid pointer was returned. 
  16050.  
  16051.  Ensure that any pointer arithmetic carried out on the pointer between 
  16052.   allocation and the failing program statement is error-free. 
  16053.  
  16054.  If the pointer is stored in an instance data area (that is, a data block 
  16055.   normally stored in the window words), ensure that the pointer to the instance 
  16056.   data area itself has been correctly read from the window words at the start 
  16057.   of processing for the current message. 
  16058.  
  16059. The allocation of a Presentation Manager resource may also fail for reasons 
  16060. associated with its parent window.  See Failure to Allocate Resources below. 
  16061.  
  16062. One additional cause of this error is the application releasing an instance 
  16063. data block too early in the processing of a WM_DESTROY message.  If the memory 
  16064. object containing this data block is released, and the application then 
  16065. attempts to release other resources whose handles are contained within the data 
  16066. block, OS/2 will not allow access to the memory.  This problem is easily 
  16067. resolved by releasing the instance data block after other resources. 
  16068.  
  16069. Trap 000E 
  16070.  
  16071. This error indicates that an application under OS/2 Version 2.0 attempted to 
  16072. access an area in memory for which an address range had been allocated, but no 
  16073. storage committed.  This error typically occurs when writing data objects into 
  16074. application data areas, since most operating system and Presentation Manager 
  16075. resources are automatically committed upon allocation. 
  16076.  
  16077. The usual cause of such an error is that the application failed to include the 
  16078. PAG_COMMIT flag in the DosAllocMem() function call that allocated the resource, 
  16079. or failed to issue a DosSetMem() call when increasing the size of a memory 
  16080. object.  The problem may be easily resolved simply by including the PAG_COMMIT 
  16081. flag or including a DosSetMem() call to ensure that sufficient storage is 
  16082. available before writing to a memory object. 
  16083.  
  16084. Failure to Allocate Resources 
  16085.  
  16086. A common error shows itself when Presentation Manager resources cannot be 
  16087. allocated correctly by an application.  This occurs most frequently with 
  16088. resources allocated upon creation of a window, during processing of the 
  16089. WM_CREATE message. 
  16090.  
  16091. The cause of the error is a failure, on the part of the application, to 
  16092. complete the default processing of the WM_CREATE message, before carrying out 
  16093. application-specific processing.  Part of this default processing involves the 
  16094. allocation of a Presentation Manager control block for the window, allocation 
  16095. of a window handle etc.  If this processing is not performed, via a 
  16096. WinDefWindowProc() function call, at the commencement of processing for the 
  16097. WM_CREATE message, function calls which use parameters such as the window 
  16098. handle will fail. 
  16099.  
  16100. The problem may be easily resolved by placing a WinDefWindowProc() function 
  16101. call as the first statement in the processing for the WM_CREATE message. 
  16102.  
  16103. Stack Space Exceeded 
  16104.  
  16105. This error may appear in either of two places: 
  16106.  
  16107.  If it appears during a call to an application subroutine, it usually 
  16108.   indicates that the space reserved for the application's stack is insufficient 
  16109.   for the number of nested function calls, local variables, etc., being used by 
  16110.   the application. 
  16111.  
  16112.  If it appears during a call to an operating system or Presentation Manager 
  16113.   function, it may indicate the same cause as above, or that the limit of the 
  16114.   application's Ring 2 stack, used by system-level code invoked by the 
  16115.   application, has been exceeded. 
  16116.  
  16117. The application's stack size may be exceeded in situations where the 
  16118. application makes a large number of nested subroutine calls, particularly where 
  16119. extensive recursion is used, and/or where large numbers of local variables are 
  16120. defined.  In such cases, the stack may be need to be increased beyond the 
  16121. recommended minimum of 8KB, using the STACKSIZE statement in application's 
  16122. module definition file. 
  16123.  
  16124. The Ring 2 stack limit is normally exceeded only in situations where a 
  16125. system-level function attempts to retrieve more items from the stack than were 
  16126. originally placed there.  This can occur where an application passes an 
  16127. incorrect parameter to a function; for example, if a parameter is declared by 
  16128. the function as an array of eight elements, but the application passes an array 
  16129. containing only seven elements, an error may occur when the function attempts 
  16130. to retrieve eight elements from the Ring 2 stack for processing. 
  16131.  
  16132. While such an error may reveal itself during compilation, certain C typecasting 
  16133. conventions may mask the problem until run time.  Where this error occurs 
  16134. during execution, careful checking of parameters is recommended. 
  16135.  
  16136. Window Fails to Appear 
  16137.  
  16138. This error occurs when an application issues a WinCreateWindow() or 
  16139. WinCreateStdWindow() function call to create a display window, but the window 
  16140. fails to appear on the desktop, even though the function returns a valid window 
  16141. handle.  This error may result from either of two causes: 
  16142.  
  16143.  The WS_VISIBLE flag may not be set in the frame creation flags for the 
  16144.   window. 
  16145.  
  16146.  The application may include the FCF_ICON or FCF_ACCELTABLE frame creation 
  16147.   flags, but no icon or accelerator table resources are defined with resource 
  16148.   identifiers which match the window identifier. 
  16149.  
  16150. In both cases, the WinCreateWindow or WinCreateStdWindow() function will return 
  16151. a valid window handle, since the window has been created. 
  16152.  
  16153. In the first case, the problem may be rectified by including the WS_VISIBLE 
  16154. flag in the frame creation flags, or by using the WinShowWindow() function to 
  16155. explicitly make the window visible. 
  16156.  
  16157. In the second case, resources should be defined in the application's resource 
  16158. script file to match the FCF_ICON and FCF_ACCELTABLE frame creation flags. 
  16159. These resources must have identifiers that match the window identifier given in 
  16160. the WinCreateWindow() or WinCreateStdWindow() calls, since Presentation Manager 
  16161. uses this identifier to load the resources. 
  16162.  
  16163.  
  16164. ΓòÉΓòÉΓòÉ 26.3.2. Repetitive Action Problems ΓòÉΓòÉΓòÉ
  16165.  
  16166. Application errors that only reveal themselves after an action has been 
  16167. performed many times typically result from the application exceeding an 
  16168. operating system or Presentation Manager resource constraint.  Resources such 
  16169. as window handles, presentation spaces, memory objects and so on, have finite 
  16170. limits. If an application repeatedly requests allocation of such resources 
  16171. without releasing them, these limits may be exceeded, in which case the 
  16172. resource will not be allocated and the application may fail when attempting to 
  16173. use the resource. 
  16174.  
  16175. Such problems may manifest themselves as Trap 000D errors that will result in 
  16176. application termination, or may simply corrupt execution of the application. 
  16177. The effect is dependent upon the (invalid) contents of the resource handle when 
  16178. the application issues a function call that uses the resources.  In certain 
  16179. cases, a function call may cause the application to enter an endless loop 
  16180. within the processing of one message, in which case the entire Presentation 
  16181. Manager desktop may "lock up". 
  16182.  
  16183. This problem may be avoided by ensuring that all resource requests (DosGet...() 
  16184. and WinGet...() function calls) in the code are matched by corresponding 
  16185. DosRelease...() and WinRelease() function calls.  In accordance with the 
  16186. principle of encapsulating function, resources required for processing a 
  16187. particular message should be allocated, used and released during the processing 
  16188. of that message. 
  16189.  
  16190. An exception to this rule occurs in the case of resources such as control 
  16191. blocks, presentation spaces for display windows, etc.  These are typically 
  16192. allocated during processing of the WM_CREATE message, and persist throughout 
  16193. the life of the window, until released during processing of the WM_DESTROY 
  16194. message. 
  16195.  
  16196.  
  16197. ΓòÉΓòÉΓòÉ 26.4. Post-Resolution Action ΓòÉΓòÉΓòÉ
  16198.  
  16199. Once a problem has been identified and corrections made to the application, the 
  16200. resolution of the problem should be documented and placed, along with the 
  16201. original problem documentation, in some form of log.  In this way, similar 
  16202. problems encountered at a later date may be more easily identified and resolved 
  16203. by reference to the log. 
  16204.  
  16205. Step #6:  After resolving the problem, document the resolution for future 
  16206.           reference. 
  16207.  
  16208. Logging systems for such information may range widely in complexity and 
  16209. sophistication, from simple paper files to automated database systems with 
  16210. keyword search capabilities.  The level of system implemented by a development 
  16211. organization is dependent upon cost and the perceived productivity benefit to 
  16212. be gained from such information; organizations with an ongoing involvement in 
  16213. the development of complex Presentation Manager applications will derive 
  16214. greater benefits than those with only a single development project. 
  16215.  
  16216.  
  16217. ΓòÉΓòÉΓòÉ 26.5. Summary ΓòÉΓòÉΓòÉ
  16218.  
  16219. Problem determination in the Presentation Manager environment is similar to 
  16220. that for other application environments, and proceeds through a number of 
  16221. phases: 
  16222.  
  16223.  1. Documentation 
  16224.  
  16225.     a) Failing window 
  16226.  
  16227.     b) User action which caused the failure 
  16228.  
  16229.     c) Whether the failure occurs upon first performing the action, or only 
  16230.        upon repetitive actions 
  16231.  
  16232.  2. Isolation 
  16233.  
  16234.  3. Identification and resolution. 
  16235.  
  16236. The documentation phase is normally part of the application testing cycle, and 
  16237. is performed by those responsible for such testing.  No particular technical or 
  16238. programming skills are required for this phase. 
  16239.  
  16240. Proper documentation of the failure usually allows a developer to determine the 
  16241. window procedure and message which caused the failure.  This provides a useful 
  16242. starting point at which to search for the underlying problem. 
  16243.  
  16244. The isolation phase is normally employed only for those failures that occur 
  16245. every time a particular action is performed, and involves the use of a symbolic 
  16246. debugging tool to single-step through the processing of the failing message, in 
  16247. order to determine the statement in the source code at which the error occurs. 
  16248.  
  16249. Problems that occur only after many repetitions of a particular user action 
  16250. normally indicate that an operating system or Presentation Manager resource 
  16251. limit has been exceeded.  This is usually the result of an application 
  16252. acquiring resources and failing to release them.  In such cases, the resolution 
  16253. process may be expedited by immediately checking the processing of the 
  16254. offending message for resource allocation statements, and ensuring that each of 
  16255. these is matched by a corresponding statement that releases the resource. 
  16256.  
  16257. Once the problem is narrowed down to a single application statement, the 
  16258. identification phase determines the cause of the problem and makes appropriate 
  16259. corrections to the source code.  This phase requires familiarity with the OS/2 
  16260. and Presentation Manager environments. 
  16261.  
  16262. When the application has been corrected and submitted once more for testing, 
  16263. the problem and its resolution should be documented and this information made 
  16264. available for future problem determination activities. The availability of such 
  16265. information may be used to more quickly determine likely causes of similar 
  16266. problems in the future. 
  16267.  
  16268.  
  16269. ΓòÉΓòÉΓòÉ 27. Generic Application Modules ΓòÉΓòÉΓòÉ
  16270.  
  16271. As mentioned throughout this document, the Presentation Manager application 
  16272. model promotes the reuse of application objects, by facilitating code 
  16273. modularity through data abstraction and encapsulation. With correct design 
  16274. procedures, it is possible to create generic application objects that may be 
  16275. used by multiple applications.  Should subsequent applications require 
  16276. modification to allow different processing of particular message classes, this 
  16277. may be achieved through subclassing. The Workplace Shell application model 
  16278. introduced in OS/2 Version 2.0 provides even more potential for reuse, due to 
  16279. its enhanced support of inheritance and subsequently enhanced provision for 
  16280. object reuse. 
  16281.  
  16282. Standardization and reuse of application code promotes consistency between 
  16283. applications in terms of processing techniques and user interfaces, and helps 
  16284. to enforce organizational programming and interface design standards. It also 
  16285. reduces the amount of new code required for applications, potentially 
  16286. shortening development time, and the use of previously developed and tested 
  16287. code may also decrease application testing time. 
  16288.  
  16289. In situations where reusability at the application object level is either not 
  16290. possible or impractical, common application functions may still be developed as 
  16291. subroutines, and placed in libraries for access by multiple applications.  The 
  16292. use of such subroutines reduces application development time. 
  16293.  
  16294. This chapter examines the creation of such generic objects and subroutines 
  16295. within the Presentation Manager application model, and their placement in 
  16296. dynamic link libraries for subsequent use by applications.  Since Workplace 
  16297. Shell objects are by definition placed in DLLs and available for reuse, they 
  16298. are not explicitly discussed in this chapter. 
  16299.  
  16300.  
  16301. ΓòÉΓòÉΓòÉ 27.1. Generic Application Objects ΓòÉΓòÉΓòÉ
  16302.  
  16303. Within the Presentation Manager application model, a window procedure provides 
  16304. both the definition of a data object and the methods that operate upon that 
  16305. data object.  A window procedure may therefore be considered as a complete 
  16306. application object in its own right. 
  16307.  
  16308. Where the data object to be manipulated by a window will be accessed by a 
  16309. number of applications, it makes sense to define the data object and its 
  16310. methods once, in a single window procedure, and to make that window procedure 
  16311. available to any application that needs to manipulate the data object.  Any 
  16312. changes to the data object's characteristics or processing requirements can 
  16313. then be contained within the application object, avoiding the need to modify 
  16314. and recompile multiple applications.  The dynamic linking capabilities of OS/2 
  16315. facilitate such a technique, enabling such modifications to be automatically 
  16316. incorporated into applications at load time or run time. 
  16317.  
  16318.  
  16319. ΓòÉΓòÉΓòÉ 27.1.1. Display Windows ΓòÉΓòÉΓòÉ
  16320.  
  16321. A display window may be created as a generic application object, and its window 
  16322. procedure placed in a dynamic link library.  The following steps are typically 
  16323. followed in creating such a window procedure: 
  16324.  
  16325.  1. Both the window procedure and a calling routine to create the window are 
  16326.     written in the normal manner. 
  16327.  
  16328.  2. The routine containing the code to create the window is declared as an 
  16329.     exportable entry point, and may thus be called by applications. 
  16330.  
  16331.  3. This routine returns the handle of the newly created window to the calling 
  16332.     application, along with a success or failure code. 
  16333.  
  16334.  4. The source code is compiled and link edited as described in Creating a DLL. 
  16335.  
  16336. The calling application then simply issues a single function call, such as: 
  16337.  
  16338. usSuccess = CreateEditWindow(hEdit);
  16339.  
  16340. The CreateEditWindow() function within the DLL handles all necessary operations 
  16341. including registration of the window class and creation of the window, places 
  16342. the resulting window handle in the address indicated by the hEdit parameter, 
  16343. and returns a success or failure code (usSuccess) to the calling application. 
  16344.  
  16345. Note, however, that the above example assumes that the window is created with a 
  16346. predetermined title, size and position on the desktop.  Should this not be the 
  16347. case, additional parameters to the CreateWindow() function would be required. 
  16348.  
  16349. The definition of the CreateEditWindow() function as the only entry point in 
  16350. the DLL enforces the consistency of using this function.  The calling 
  16351. application is still provided with the window handle, which allows it to 
  16352. communicate with the window and to subclass the window if required. 
  16353.  
  16354.  
  16355. ΓòÉΓòÉΓòÉ 27.1.2. Object Windows ΓòÉΓòÉΓòÉ
  16356.  
  16357. Object windows may be created and placed into dynamic link libraries in a 
  16358. similar manner to that already explained for display windows.  However, object 
  16359. windows have an additional complication in that they are frequently created in 
  16360. secondary threads in order to handle long-running application tasks. 
  16361.  
  16362. The steps in creating an object window for inclusion in a DLL are therefore as 
  16363. follows: 
  16364.  
  16365.  1. The window procedure, the calling routine to create the window and a 
  16366.     routine to start the secondary thread from which the window is created, are 
  16367.     written in the normal manner, as described in Threads Containing Object 
  16368.     Windows. 
  16369.  
  16370.  2. The routine containing the code to start the secondary thread is declared 
  16371.     as an exportable entry point, and may thus be called by applications. 
  16372.  
  16373.  3. The source code is compiled and link edited as described in Creating a DLL. 
  16374.  
  16375. Note that the routine called by the application does not return the handle of 
  16376. the newly created window.  Indeed, it cannot do so, since the creation of the 
  16377. window takes place asynchronously, in a secondary thread. 
  16378.  
  16379. This obstacle is overcome by having the calling application (typically a window 
  16380. procedure) pass its own window handle as a parameter.  This is passed to the 
  16381. object window, which then passes an acknowledgement message to the calling 
  16382. window procedure, containing its window handle.  The calling window procedure 
  16383. may subsequently communicate with or subclass the object window as required. 
  16384. This technique is described, along with an example, in Threads Containing 
  16385. Object Windows. 
  16386.  
  16387.  
  16388. ΓòÉΓòÉΓòÉ 27.1.3. Subclassing ΓòÉΓòÉΓòÉ
  16389.  
  16390. When a generic application object (that is, window class) does not quite meet 
  16391. the requirements of an application, a developer may choose to use the generic 
  16392. object and modify its behavior, through subclassing, to meet the specific 
  16393. requirements.  This may be easily achieved in conjunction with the methods 
  16394. described above, since the handle of the newly created window is either 
  16395. returned directly by the called routine or indirectly by the window itself. 
  16396. This handle can then be used in the WinSubclassWindow() function call. 
  16397.  
  16398. The subject of subclassing is described in detail in Subclassing a Window, 
  16399. along with examples of both the WinSubclassWindow() function and a subclass 
  16400. window procedure. 
  16401.  
  16402.  
  16403. ΓòÉΓòÉΓòÉ 27.2. Dialog Boxes ΓòÉΓòÉΓòÉ
  16404.  
  16405. Standard dialog boxes to handle commonly performed user dialogs may also be 
  16406. generated and placed in dynamic link libraries.  The inclusion of a dialog box 
  16407. in a DLL however, is slightly more complicated than the inclusion of a "normal" 
  16408. display or object window, due to the definition of the dialog template as a 
  16409. Presentation Manager resource.  The DLL must therefore include not only the 
  16410. dialog procedure and the invoking routine, but also the dialog template 
  16411. definition. 
  16412.  
  16413. This necessitates the invoking routine within the DLL not only executing the 
  16414. WinDlgBox() function call, but also obtaining a module handle for the DLL and 
  16415. an entry point address for the dialog procedure.  The necessary steps are as 
  16416. follows: 
  16417.  
  16418.  1. The dialog procedure and the invoking routine are developed and placed in a 
  16419.     dynamic link library. 
  16420.  
  16421.  2. The invoking routine is declared as an exportable entry point and may thus 
  16422.     be called by applications. 
  16423.  
  16424.  3. The dialog template is created using the Dialog Box Editor, resource 
  16425.     compiled and combined with the DLL. 
  16426.  
  16427. The invoking routine for a dialog box loaded from a DLL is described, along 
  16428. with an example, in Figure "Loading a Dialog Resource From a DLL". 
  16429.  
  16430.  
  16431. ΓòÉΓòÉΓòÉ 27.3. Generic Subroutines ΓòÉΓòÉΓòÉ
  16432.  
  16433. In addition to code reuse at the application object level, significant 
  16434. productivity gains can be achieved by the reuse of application code at the 
  16435. subroutine level, to carry out common operating system and Presentation Manager 
  16436. functions. 
  16437.  
  16438. For example, initialization functions are required to perform tasks related to 
  16439. initializing the Presentation Manager environment and any data areas to be used 
  16440. by utility routines.  Functions required to be performed include: 
  16441.  
  16442.  Registration of the application to Presentation Manager 
  16443.  Creation of a message queue 
  16444.  Creation of an entry in the Workplace Shell Window List. 
  16445.  
  16446. These functions may be combined into one or more standard initialization 
  16447. routines, which may be invoked upon entry to an application or thread. Examples 
  16448. of the necessary code are given in Figure "Sample Application Main Routine 
  16449. (Part 1) - Registration", Figure "Sample Application Main Routine (Part 2) - 
  16450. Window Creation" and Figure "WinAddSwitchEntry() Function". 
  16451.  
  16452. Termination functions required by Presentation Manager applications could also 
  16453. be standardized;  these functions include: 
  16454.  
  16455.  Removing the application from the Workplace Shell Window List 
  16456.  Destroying the application's main window 
  16457.  Destroying the primary thread's message queue 
  16458.  Deregistration of the application from the Presentation Manager environment. 
  16459.  
  16460. These operations are performed by Presentation Manager upon termination of the 
  16461. application if the application does not perform them explicitly.  However, it 
  16462. is recommended that the application carries out these actions, since they may 
  16463. then be achieved in a controlled manner.  Examples of the necessary code are 
  16464. given in Figure "Sample Application Main Routine (Part 2) - Window Creation". 
  16465.  
  16466. Other functions may often be required during the execution of an application, 
  16467. such as: 
  16468.  
  16469.  Obtaining the window handle of the application's main client window. An 
  16470.   example of this procedure is given in Identifying the Destination Window. 
  16471.  
  16472.  Passing a message from a subclass window procedure to the original window 
  16473.   procedure for that window class.  An example is given in Figure "Subclass 
  16474.   Window Procedure". 
  16475.  
  16476. These functions may also be combined into standard subroutines and placed in a 
  16477. library, thereby avoiding the need for application developers to repetitively 
  16478. code such functions. 
  16479.  
  16480. A final function often used in the stepwise development of object-oriented 
  16481. Presentation Manager applications is a small routine to display a message box 
  16482. with the message "Action Not Yet Implemented", invoked when the user selects a 
  16483. menu bar or pulldown entry for which a method has not yet been coded.  This 
  16484. function is typically invoked as the default case for the WM_COMMAND message 
  16485. class.  In this way, methods within a window procedure may be implemented in a 
  16486. stepwise manner, and testing of existing methods may occur while new ones are 
  16487. being added.  Selecting an action for which no method has yet been implemented 
  16488. will always result in the same message box being displayed. 
  16489.  
  16490.  
  16491. ΓòÉΓòÉΓòÉ 27.4. Granularity ΓòÉΓòÉΓòÉ
  16492.  
  16493. When placing generic code in a dynamic link library, whether that code is at 
  16494. the application object level or at the functional level, the question arises as 
  16495. to the way in which the code should be partitioned into individual DLL modules, 
  16496. and thus the level of granularity that will be achieved within the reusable 
  16497. code. 
  16498.  
  16499. This decision must be made on the basis of interdependence; where routines are 
  16500. interdependent and are required or likely to be used together, it is advisable 
  16501. to place them in a single dynamic link library.  For example, a group of 
  16502. standard window manipulation routines would typically reside in single DLL. 
  16503.  
  16504. However, generic application objects should bear no predefined relationship to 
  16505. one another, and generic window classes may therefore be used independently. 
  16506. In such a case, the window procedure and invoking routine for each window class 
  16507. should be placed in a separate DLL, along with any subroutines specific to that 
  16508. window procedure.  Applications that desire to use more than one such 
  16509. application object may then access multiple DLLs. 
  16510.  
  16511.  
  16512. ΓòÉΓòÉΓòÉ 27.5. Packaging ΓòÉΓòÉΓòÉ
  16513.  
  16514. When a set of application objects and/or subroutines has been created and 
  16515. placed into a dynamic link library, the following items will have been 
  16516. generated: 
  16517.  
  16518.  The dynamic link library containing the application objects and/or 
  16519.   subroutines 
  16520.  
  16521.  A header file containing declarations for the routines that will be called by 
  16522.   applications in order to create the application objects or invoke the 
  16523.   subroutines 
  16524.  
  16525.  An import library file, containing entry point definitions for those routines 
  16526.   that will be called by applications. 
  16527.  
  16528. These items must be stored in a location from which application developers may 
  16529. access them.  The use of a local area network to provide and manage access to 
  16530. such items is discussed in Managing Development. 
  16531.  
  16532. In addition, appropriate entries must be included in an interface control 
  16533. document, which defines all common application objects and subroutines along 
  16534. with their external interfaces, and acts as a reference for application 
  16535. developers who wish to use such objects or routines. 
  16536.  
  16537.  
  16538. ΓòÉΓòÉΓòÉ 27.6. Summary ΓòÉΓòÉΓòÉ
  16539.  
  16540. The Presentation Manager application model affords the opportunity for 
  16541. significant standardization and reuse of application code, at both the 
  16542. application object and function levels.  The dynamic linking facilities 
  16543. provided by OS/2 allow this capability to be carried over to executable code as 
  16544. well as source code.  Such reusability reduces the amount of new code required 
  16545. for applications, thereby reducing the development time and cost of new 
  16546. applications. 
  16547.  
  16548. Common application elements such as windows and dialogs may be defined and 
  16549. stored in dynamic link libraries for access by one or more applications, thus 
  16550. implementing reusability at the application object or dialog level. At a lower 
  16551. level, a large number of common Presentation Manager application tasks may be 
  16552. identified, which may also be placed in standard routines for purposes of 
  16553. enhancing programmer productivity. 
  16554.  
  16555. A further benefit of using standardized routines is the improvement in the 
  16556. consistency of both the application code and the user interface.  Such 
  16557. standardization provides an easy means of enforcing Systems Application 
  16558. Architecture CUA standards without the need for programmers to repetitively 
  16559. code definitions for an CUA-conforming user interface.  In addition, the 
  16560. standardized implementation of various functions and techniques eases the task 
  16561. of application maintenance, since all applications will behave in a similar 
  16562. manner through the use of common code. 
  16563.  
  16564. Although the functions mentioned in this chapter are restricted to Presentation 
  16565. Manager functions, the same principles may be applied to other functions, 
  16566. dialogs etc., which are common to multiple applications within the 
  16567. organization. The creation of standard routines for such functions, and the 
  16568. incorporation of these routines into dynamically linked modules under OS/2, may 
  16569. enhance the modularity and granularity of applications and bring additional 
  16570. benefits through reduced development time for new applications, and through 
  16571. easier application maintenance and change management. 
  16572.  
  16573.  
  16574. ΓòÉΓòÉΓòÉ 28. Managing Development ΓòÉΓòÉΓòÉ
  16575.  
  16576. In order to enable the implementation of large-scale applications in the 
  16577. programmable workstation environment, with multiple application developers 
  16578. participating in design, coding and testing, it is important not only to have 
  16579. an appropriate technological and architectural base for development, but also 
  16580. to provide appropriate and effective management of and control over the 
  16581. development process and development resources.  Established techniques exist in 
  16582. the host-based application development environment for addressing such issues, 
  16583. but historically, the considerations of large-scale management and control have 
  16584. been overlooked in the workstation environment due to the relatively minor 
  16585. nature of workstation-based development projects in the past. 
  16586.  
  16587. Two areas worthy of note in the workstation-based development environment are 
  16588. the management of developmental risk, and the management and control of 
  16589. development resources that are used and created during the application 
  16590. development process.  This chapter will briefly describe these issues and offer 
  16591. some suggestions as to how they may be effectively resolved.  Much of the 
  16592. discussion in this chapter will deal with Presentation Manager applications 
  16593. written using the C programming language, but the techniques described may be 
  16594. adapted to suit other environments and programming languages. 
  16595.  
  16596.  
  16597. ΓòÉΓòÉΓòÉ 28.1. Risk Management ΓòÉΓòÉΓòÉ
  16598.  
  16599. In any application development project, there are risks imposed by the use of 
  16600. new technologies and methods.  These risks may be divided into two basic types: 
  16601.  
  16602.  Technological risk; that which is imposed by new or unfamiliar technologies 
  16603.   which will be used in an application or during the creation of the 
  16604.   application. 
  16605.  
  16606.  Managerial risk; that which arises from the lack of established management 
  16607.   techniques to support new technologies and methods. 
  16608.  
  16609. These two elements of risk are closely related, and affect one another in a 
  16610. variety of ways.  The following sections discuss both elements and suggest some 
  16611. mechanisms for their mitigation. 
  16612.  
  16613.  
  16614. ΓòÉΓòÉΓòÉ 28.1.1. Technological Risk ΓòÉΓòÉΓòÉ
  16615.  
  16616. Technological risks may take a wide variety of forms, and vary from simple 
  16617. risks to highly complex instances involving the interrelationship of many 
  16618. divergent technologies.  Some relatively simple examples of technological risk 
  16619. are: 
  16620.  
  16621.  Use of a new prototyping tool 
  16622.  
  16623.  Use of a programming language other than that which is normally used by the 
  16624.   particular development organization 
  16625.  
  16626.  Use of a new programming interface 
  16627.  
  16628.  Incorporation of new analysis techniques for the gathering of requirements. 
  16629.  
  16630. The element of risk in the incorporation of new technologies arises from the 
  16631. simple fact that they are new, and likely to be unfamiliar to the majority of 
  16632. development personnel.  A period of learning will be necessary, and the 
  16633. probable length of this period must be assessed in the light of required 
  16634. development schedules.  Technological risk is always greater where new 
  16635. techniques and procedures must be evolved in order to support and exercise the 
  16636. new technologies, since elements of managerial risk are then involved.  Simple 
  16637. technological tools are relatively easy to learn and use, but techniques for 
  16638. their effective employment are often learned over a longer period. 
  16639.  
  16640. The decision as to whether to utilize new technologies in a development project 
  16641. must be based upon the question of whether the development organization 
  16642. possesses the requisite skills to effectively exercise the new technologies, or 
  16643. can acquire such skills within the timeframe of the development project, 
  16644. without adversely affecting the schedule and budget of the project.  If the 
  16645. first question can be answered in the positive, there is no risk involved; if 
  16646. not, then it is the second question that constitutes the element of risk. 
  16647.  
  16648. Technological risk may be mitigated by ensuring that development personnel 
  16649. possess the necessary skills to effectively utilize the new technologies, 
  16650. through the provision of relevant education.  The potential benefit to be 
  16651. gained from the use of these technologies must be identified and quantified, in 
  16652. terms of enhanced application functionality, reduced development time and cost, 
  16653. etc.  This benefit must be weighed against the time and cost involved in 
  16654. training personnel to a sufficient skill level in order to effectively mitigate 
  16655. the risk, and against the schedule and budget imposed upon the development 
  16656. organization. 
  16657.  
  16658. Technological risk may also be mitigated by minimizing the managerial risk 
  16659. involved in the use of new technologies.  If established managerial techniques 
  16660. can be adapted and applied to the implementation of new technologies, the use 
  16661. of these mechanisms may provide a greater degree of control over the 
  16662. development process, and help to control and reduce the associated 
  16663. technological risk.  Thus it can be seen that technological and managerial risk 
  16664. are closely related and complimentary to one another. 
  16665.  
  16666.  
  16667. ΓòÉΓòÉΓòÉ 28.1.2. Managerial Risk ΓòÉΓòÉΓòÉ
  16668.  
  16669. Managerial risk is somewhat more complex than technological risk, since it 
  16670. involves the effective administration of and control over the use of new 
  16671. technologies. While it is possible to train or employ development personnel in 
  16672. order to gain the required skills in the use of new technologies, it is less 
  16673. easy to obtain the managerial skills necessary to ensure the maximum benefit is 
  16674. gained from their use. 
  16675.  
  16676. Like technological risk, managerial risk may also vary from the relatively 
  16677. simple to the highly complex.  Some examples of managerial risk are: 
  16678.  
  16679.  Transformation of new analysis techniques into application design 
  16680.   specifications 
  16681.  
  16682.  Establishment of effective control procedures for a new development 
  16683.   environment 
  16684.  
  16685.  Measurement of programmer productivity when using a new programming tool or 
  16686.   language. 
  16687.  
  16688. The managerial risk arises not from the question of whether sufficient skills 
  16689. are present to utilize new technologies, but from the question of whether 
  16690. managerial personnel are sufficiently well-versed in the concepts underlying 
  16691. these technologies to provide effective administration and control over the use 
  16692. of the technologies, in order to ensure that maximum benefit is gained from 
  16693. their use. 
  16694.  
  16695. Managerial risk may be mitigated by ensuring that managerial personnel possess 
  16696. a sufficient grounding in the principles underlying new technologies, in order 
  16697. that they may successfully adapt existing managerial techniques to the 
  16698. administration and control of the new technologies. These skills may be 
  16699. acquired in a similar manner to the technological skills required by 
  16700. programmers, through training and familiarity with the technologies involved. 
  16701. The decision must be made as to whether the benefit to be gained from the use 
  16702. of these technologies is sufficient to offset the time and effort involved in 
  16703. acquiring the necessary skills and establishing the managerial techniques to 
  16704. effectively control their use. 
  16705.  
  16706. Managerial risk may also be mitigated by reducing the associated technological 
  16707. risk.  For example, a new technology such as object-oriented programming 
  16708. principles can be implemented using tools such as the C programming language 
  16709. and Presentation Manager.  There is likely to be a higher degree of familiarity 
  16710. with such tools in the development organization than with tools such as C++ or 
  16711. Smalltalk V.  Therefore, implementation of object-oriented principles may be 
  16712. more effectively controlled by the application of established managerial 
  16713. techniques for C application development.  While this will not eliminate the 
  16714. element of risk altogether, it will significantly reduce the managerial risk 
  16715. involved, and also help to mitigate the technological risk by facilitating 
  16716. effective control over the development process. 
  16717.  
  16718.  
  16719. ΓòÉΓòÉΓòÉ 28.2. Configuration/Library Management ΓòÉΓòÉΓòÉ
  16720.  
  16721. While the same techniques of management are valid in both host and workstation 
  16722. environments, the distributed nature of the workstation environment presents 
  16723. difficulties for the centralized control and administration of development 
  16724. resources.  This section provides some suggestions as to the ways in which a 
  16725. local area network (LAN) may be used to provide centralized control and 
  16726. administration to a workstation-based application development environment. 
  16727.  
  16728. In the case of C language applications developed for the Presentation Manager 
  16729. environment, development resources include: 
  16730.  
  16731.  Application source modules.  An application source module is defined to 
  16732.   comprise not only the source code itself, but also the local and external 
  16733.   interface include files that accompany the source code (see Application 
  16734.   Program Construction). 
  16735.  
  16736.  Existing code libraries; these may need to be modified or additional routines 
  16737.   generated in order to meet the requirements of the application. 
  16738.  
  16739.  Presentation Manager resources such as icons, fonts, bitmaps and dialog 
  16740.   definitions. 
  16741.  
  16742.  Test data sets or databases. 
  16743.  
  16744.  Compilers, link-editors, run-time libraries and other development tools;  in 
  16745.   an evolving development environment, it is crucial to ensure that all 
  16746.   development personnel use the same version and modification level of compiler 
  16747.   and linkage editor software, and that programming language runtime libraries 
  16748.   are consistent in their version. 
  16749.  
  16750. These resources must be created, tested and placed in locations from which they 
  16751. may be accessed easily and concurrently by a number of application developers, 
  16752. while at the same time maintaining adequate control over their access and 
  16753. particularly over any modifications made to individual modules. 
  16754.  
  16755. A LAN provides a useful means of enabling access by multiple developers to a 
  16756. common repository of application resources.  The ways in which a LAN may be 
  16757. used to address the configuration management issues arising from the PWS 
  16758. development environment are described in the following sections. 
  16759.  
  16760.  
  16761. ΓòÉΓòÉΓòÉ 28.2.1. Terminology ΓòÉΓòÉΓòÉ
  16762.  
  16763. In the subsequent discussion of configuration and library management, the 
  16764. following terminology will be used.  The term application resource will be used 
  16765. to indicate a particular development resource such as a source module (along 
  16766. with its supporting include file), a custom-developed dynamic link library 
  16767. (that is, a dynamic link library not taken from a group of generic library 
  16768. modules), a Presentation Manager resource such as an icon or dialog definition 
  16769. etc., which is specific to the current application.  Other development 
  16770. resources such as compilers, link-editors, programmers' toolkits, generic code 
  16771. libraries and so on, may be used in the development of an application, but are 
  16772. not considered to be application resources. 
  16773.  
  16774. The term production level will be used to indicate a version of an application 
  16775. resource that has been created, tested and approved for placement in a 
  16776. production library.  The process of testing and subsequent approval for 
  16777. placement in a production library is called baselining. 
  16778.  
  16779. The term user level will be used to indicate a version of an application 
  16780. resource that is currently undergoing modification, and has not been either 
  16781. tested or placed in a production library.  The actual transfer of an 
  16782. application resource from a developer's local work library to a production 
  16783. library is called promotion. 
  16784.  
  16785.  
  16786. ΓòÉΓòÉΓòÉ 28.2.2. Network Organization ΓòÉΓòÉΓòÉ
  16787.  
  16788. The topology of a local area network is very much determined by the structure 
  16789. of the development organization, and by the size and nature of the projects 
  16790. undertaken by that organization.  The techniques of LAN installation, 
  16791. configuration and management are beyond the scope of this document.  However, 
  16792. it is possible to formulate some simple guidelines which facilitate management 
  16793. of the development process. 
  16794.  
  16795. Local area networks are typically divided into logical partitions known as 
  16796. domains. A domain is defined as a logical subgroup of a network, which contains 
  16797. a defined group of network nodes (machines), a defined set of network resources 
  16798. such as shared disks, directories and printers, and a defined set of authorized 
  16799. users.  Each domain thus forms a logical network in its own right, and multiple 
  16800. domains may exist on a single physical network.  A domain may include resources 
  16801. residing on multiple network server nodes, and multiple domains may access the 
  16802. resources of any particular server.  Each user on the network is provided with 
  16803. a unique user ID and password.  An application developer may be defined as an 
  16804. authorized user of multiple domains within the same physical network; the same 
  16805. or different user IDs and passwords may be used. Figure "Network Domains" 
  16806. illustrates a network with three domains, each containing a number of network 
  16807. nodes.  Each domain has one or more server nodes (marked S) upon which reside 
  16808. shared resources accessible by users on other nodes. Note that the servers may 
  16809. be accessed from within a single domain or from multiple domains, and that 
  16810. other network nodes may also belong to multiple domains.  Note also that there 
  16811. is no direct mapping between a network node and a network user; a user may, in 
  16812. principle, sign on and access server resources from any network node in the 
  16813. domain. 
  16814.  
  16815. Assuming a project-team orientation in the development organization, it is 
  16816. expedient to logically group the members of a particular project team, in order 
  16817. that they may be treated as a distinct group and separated from other project 
  16818. teams for purposes of resource access and administration. 
  16819.  
  16820. In the simplest case, a number of project teams in the same physical location 
  16821. would use the same physical network, partitioned into separate domains for each 
  16822. project team.  Each domain would possess its own set of production libraries 
  16823. for application resources; other development resources such as compilers and 
  16824. generic code libraries, which are common across the entire development 
  16825. organization, would be stored in a production library on a single server, and 
  16826. defined within all domains.  This technique provides isolation of application 
  16827. resources while also allowing common access to other development resources, and 
  16828. eases the task of maintaining and updating these common resources since only 
  16829. one copy need exist on the network. 
  16830.  
  16831. The principle of one domain per project team is obviously a "rule of thumb" and 
  16832. must be evaluated in light of the individual development organization. In the 
  16833. case of very large projects, it may be necessary to subdivide the project team 
  16834. into manageable subgroups.  This would probably be necessary purely for 
  16835. managerial purposes, irrespective of whether a LAN were to be used. 
  16836. Conversely, very small project teams may not warrant the effort of establishing 
  16837. a separate domain, and several such small teams may be combined in a single 
  16838. management unit with a single network domain. 
  16839.  
  16840.  
  16841. ΓòÉΓòÉΓòÉ 28.2.3. Common Access to Resources ΓòÉΓòÉΓòÉ
  16842.  
  16843. On a local area network server node, directories may be created that act as 
  16844. production libraries.  Production libraries for a particular development 
  16845. project may exist on one or more network server nodes, depending upon the size 
  16846. and organization of the LAN. 
  16847.  
  16848. These libraries serve as repositories for the current production-level versions 
  16849. of all development resources.  The exact number and type of libraries created 
  16850. is highly dependent upon the structure of the development organization and the 
  16851. application under development, but the following skeleton structure is 
  16852. recommended. 
  16853.  
  16854. Figure "Production Libraries on a LAN Server" 
  16855.  
  16856. All application developers should be given read-only access to production 
  16857. libraries.  This will enable those developers to access compilers, link-editors 
  16858. and programming language run-time libraries, and to access the current 
  16859. production-level versions of application source modules, Presentation Manager 
  16860. resources and test data, but not to update those production versions. 
  16861.  
  16862. Application resources currently undergoing modification (that is, user level 
  16863. resources) are held in a work directory on the developer's own workstation, 
  16864. from which only that developer may access them.  This restriction of access is 
  16865. implicit since only appropriately declared and configured server nodes may 
  16866. share their disks and directories on the network. 
  16867.  
  16868. Production level application resources may be transparently accessed at compile 
  16869. or link-edit time by ensuring that each developer's compiler search path 
  16870. specifies the production libraries.  The search path should first specify an 
  16871. application developer's local work directory, in order to pick up any user 
  16872. level resources currently being worked upon by that developer, and then search 
  16873. the appropriate production libraries in order to pick up production level 
  16874. copies of other resources not currently subject to modification by that 
  16875. developer.  This technique ensures that each application build accesses the 
  16876. latest tested and baselined versions of all application resources, except for 
  16877. those resources that exist in the developer's local work directory, and that 
  16878. are therefore likely to be under test. 
  16879.  
  16880. Each application resource should have an owner appointed at the start of 
  16881. development.  This owner may be the application developer primarily responsible 
  16882. for the creation of a source module, or in the case of larger and more complex 
  16883. development projects, may be a developer responsible for the testing of a 
  16884. number of modules that together comprise a coherent code unit.  In either case, 
  16885. the owner is given update access to the files in the production libraries that 
  16886. comprise the module or modules under his/her jurisdiction, and only to those 
  16887. files.  The updating of each application resource may then be achieved in a 
  16888. controlled manner. 
  16889.  
  16890. This assumes that the name of the file or files containing each application 
  16891. resource is known at the outset of development.  This in turn requires a sound 
  16892. approach to application design and to the correct partitioning of the 
  16893. application at the design stage.  It also requires the adoption of a set of 
  16894. file or data set naming conventions across the development organization. 
  16895.  
  16896.  
  16897. ΓòÉΓòÉΓòÉ 28.2.4. Update/Modification of Resources ΓòÉΓòÉΓòÉ
  16898.  
  16899. When an application developer wishes to make a modification to an application's 
  16900. resources, those resources should be copied from the production library to the 
  16901. developer's local work directory.  This is known as drawdown, and must be 
  16902. recorded, including the date, time, the identity of the developer and the name 
  16903. of the module being copied.  This recording process is known as checkout.  Only 
  16904. one developer at any time must be allowed to check out and draw down a 
  16905. particular module, in order to avoid the problems inherent in the well-known 
  16906. simultaneous update situation. Control over checkouts may be achieved in a 
  16907. number of ways.  However, it is recommended that the drawdown process be 
  16908. achieved by way of a simple utility application that performs the following 
  16909. steps: 
  16910.  
  16911.  1. Accesses a central database that contains the name of each application 
  16912.     resource under development, and determines whether that resource is 
  16913.     currently checked out. 
  16914.  
  16915.  2. If the resource has been checked out, the utility application returns the 
  16916.     identity of the developer by whom the resource has been checked out 
  16917.  
  16918.  3. If the resource has not been checked out, the utility application performs 
  16919.     a checkout operation, recording the identity of the application developer 
  16920.     and that of the application resource in the central database, and draws 
  16921.     down the application resource into the developer's local work directory, 
  16922.     ready for modification. 
  16923.  
  16924. When modification of a resource is complete and the resource has been 
  16925. adequately tested, the user level version should be passed to the resource's 
  16926. owner who, after determining that appropriate testing has been satisfactorily 
  16927. carried out, should then promote the new version to production level, ready for 
  16928. access by other developers. 
  16929.  
  16930. When a user level version of an application resource is consigned to the 
  16931. resource owner, that version must be deleted from the developer's local work 
  16932. directory, in order to ensure that only the latest production level version is 
  16933. accessed by the compiler or link editor during the next build. This operation 
  16934. may be automated as part of the promotion process, or may be left as an 
  16935. explicit task for the developer. 
  16936.  
  16937.  
  16938. ΓòÉΓòÉΓòÉ 28.2.5. Administration ΓòÉΓòÉΓòÉ
  16939.  
  16940. As in any multi-user environment, some degree of system administration is 
  16941. necessary in a LAN environment.  When a LAN is used to provide a workstation 
  16942. application development platform, the LAN administrator must perform the 
  16943. following duties: 
  16944.  
  16945.  At the outset of development for a particular application, create a network 
  16946.   domain for that development project.  This is optional, and it may be 
  16947.   considered expedient to combine a number of smaller projects into a single 
  16948.   network domain. 
  16949.  
  16950.  Create the production libraries for the project's network domain. 
  16951.  
  16952.  Register each developer as a user of the project's network domain, and define 
  16953.   each developer to have read-only access to production libraries. 
  16954.  
  16955.  Provide the appointed owner of each application resource with write access to 
  16956.   the resource or resources under his/her jurisdiction. 
  16957.  
  16958.  In the case where an application resource has been checked out and remains 
  16959.   checked out for an unnecessary length of time (for example, a developer 
  16960.   checks out a resource and then goes on vacation without first submitting the 
  16961.   new version for promotion), provide an override capability to cancel the 
  16962.   checkout. 
  16963.  
  16964. It is recommended that the LAN administrator be the same person responsible for 
  16965. administration of the production libraries that contain system software such as 
  16966. compilers and link-editors, in order to place all such system administration 
  16967. responsibilities with the same person. 
  16968.  
  16969.  
  16970. ΓòÉΓòÉΓòÉ 28.3. Summary ΓòÉΓòÉΓòÉ
  16971.  
  16972. The management and mitigation of risk during the application development 
  16973. process is an important aspect of managing application development, 
  16974. particularly where new or unfamiliar technologies are to be used.  There are 
  16975. two closely related elements of risk that arise from the incorporation of new 
  16976. technologies.  These are technological risk, which arises from the need for 
  16977. adequate skills to exercise the technologies, and managerial risk, which arises 
  16978. from the need for adequate administration and control mechanisms to ensure that 
  16979. maximum benefit is gained from the use of the technologies.  It is the 
  16980. responsibility of a development manager to assess, quantify and weigh the 
  16981. potential benefits of new technologies against the risk involved in their use, 
  16982. and to provide adequate mitigation of these risks. 
  16983.  
  16984. The issue of configuration management in a distributed, workstation-based 
  16985. development environment is another issue that must be addressed in order to 
  16986. support the large-scale development of workstation-based applications.  The use 
  16987. of a local area network as a development platform for such applications has a 
  16988. number of benefits, particularly from the viewpoint of configuration management 
  16989. and control over application resources such as source code, Presentation 
  16990. Manager resources, test data and the like.  The use of a LAN provides: 
  16991.  
  16992.  Common access by all developers to production level versions of application 
  16993.   resources 
  16994.  
  16995.  The ability to directly access these production level versions during the 
  16996.   build process 
  16997.  
  16998.  The ability to combine production level versions with user level versions of 
  16999.   application resources during the build process 
  17000.  
  17001.  The ability to manage and regulate the modification and update of production 
  17002.   level application resources. 
  17003.  
  17004. The proper use of a LAN in the workstation-based development environment, and 
  17005. the achievement of the aforementioned benefits, requires the adoption of and 
  17006. adherence to a consistent set of standards in the areas of module naming, 
  17007. access and testing, and a measure of discipline on the part of application 
  17008. developers.  However, it is considered that the increased time and effort 
  17009. expended in maintaining these standards is more than offset by the reduced 
  17010. incidence of error and wastage of development time and effort imposed by the 
  17011. lack of adequate coordination and control in a multi-developer project. 
  17012.  
  17013. The issues of management and control in the workstation-based development 
  17014. environment are of increasing importance as organizations begin to develop and 
  17015. deploy line-of-business applications on workstation platforms.  These issues 
  17016. may be adequately addressed by the use of appropriate tools and the adaptation 
  17017. and application of existing management techniques.  With the proper care and 
  17018. planning, the maximum benefit may be obtained from the use of the workstation 
  17019. as a development and delivery platform for business applications. 
  17020.  
  17021.  
  17022. ΓòÉΓòÉΓòÉ 29. Naming Conventions ΓòÉΓòÉΓòÉ
  17023.  
  17024. It is often a desirable practice to implement common naming conventions for 
  17025. application routines and for symbolic constant and variable names.  The 
  17026. adoption of such techniques facilitates application readability and code 
  17027. maintenance, since the nature and role of various routines and data items used 
  17028. by an application may be more easily understood.  This chapter proposes some 
  17029. naming conventions; it is not suggested that application developers should use 
  17030. these conventions slavishly, but that they should use the suggestions provided 
  17031. as guidelines in developing their own consistent set of organizational 
  17032. standards. 
  17033.  
  17034. The conventions proposed herein will cover the following areas: 
  17035.  
  17036.  Symbolic names and constants 
  17037.  Subroutine names 
  17038.  Window and dialog procedure names 
  17039.  Variable names. 
  17040.  
  17041. The conventions proposed will adhere to most "standard" C programming 
  17042. conventions, in that lowercase characters will be used for routine and variable 
  17043. names, with uppercase characters used for symbolic names and constants. 
  17044. Application developers wishing to use standardized naming conventions for 
  17045. applications written in other languages will obviously need to adapt these 
  17046. conventions to suit their particular language implementation. 
  17047.  
  17048. The conventions proposed herein will also use a notational concept known as 
  17049. Hungarian notation, named for its inventor, Charles Simyoni.  Under this 
  17050. notational system each variable, symbolic name or procedure name is prefixed by 
  17051. a one-, two- or three-character mnemonic that indicates its type or function. 
  17052.  
  17053.  
  17054. ΓòÉΓòÉΓòÉ 29.1. Symbolic Names and Constants ΓòÉΓòÉΓòÉ
  17055.  
  17056. In a PM application, symbolic names are typically used within an application to 
  17057. represent numeric values such as message classes or control window identifiers 
  17058. by a meaningful name rather than a less meaningful numeric representation.  A 
  17059. list of suggested prefixes is given in Table "Type Prefixes for Symbolic 
  17060. Constants", to give an indication of type when using a symbolic name or 
  17061. constant. 
  17062.  
  17063. These one-, two- or three-letter prefixes may be concatenated with the actual 
  17064. symbolic names of control windows, window classes etc., in order to provide a 
  17065. more meaningful representation of the symbolic name in the source code. 
  17066.  
  17067.  
  17068. ΓòÉΓòÉΓòÉ 29.2. Subroutine Names ΓòÉΓòÉΓòÉ
  17069.  
  17070. For the purpose of discussion, a distinction will be made between subroutines 
  17071. invoked using normal programming language calling mechanisms, and window or 
  17072. dialog procedures invoked by Presentation Manager in response to the 
  17073. application issuing a WinDispatchMsg(), WinPostMsg() or WinSendMsg() call. 
  17074. Window and dialog procedures are discussed in the following section. 
  17075.  
  17076. When examining application code, it is useful to know the type of event handled 
  17077. or processing carried out by a particular function or subroutine, without the 
  17078. need for detailed examination of the code for that subroutine. This capability 
  17079. can be facilitated by the use of a prefix to the function or subroutine name, 
  17080. which indicates the type of the function or subroutine to the reader. 
  17081.  
  17082. Since the types of functions carried out within applications may be extremely 
  17083. diverse, no standards will be suggested here.  However, readers should note the 
  17084. potential benefits of such a practice, and may wish to adopt a suitable 
  17085. convention for their own applications. 
  17086.  
  17087.  
  17088. ΓòÉΓòÉΓòÉ 29.3. Window and Dialog Procedure Names ΓòÉΓòÉΓòÉ
  17089.  
  17090. In order to indicate that a particular subroutine within an application is a 
  17091. window procedure, it is suggested that all window procedure names should be 
  17092. prefixed with wp in lowercase letters.  Similarly, dialog procedures for 
  17093. processing modal dialog boxes, should be prefixed with "dp" to identify the 
  17094. nature of their processing and to differentiate them from normal window 
  17095. procedures. 
  17096.  
  17097.  
  17098. ΓòÉΓòÉΓòÉ 29.4. Variable Names ΓòÉΓòÉΓòÉ
  17099.  
  17100. It is far easier to determine the nature and usage of a variable if its data 
  17101. type is known to the reader.  Variable names may be prefixed with mnemonics 
  17102. indicating their data type, in a similar way to that proposed for symbolic 
  17103. names and constants.  A list of suggested prefixes for various data types is 
  17104. given in Table "Type Prefixes for Variables". 
  17105.  
  17106. For example, a character string variable (a zero- or null-terminated string) 
  17107. named WindowTitle might have an attached mnemonic prefix of sz to indicate the 
  17108. data type, making the variable name szWindowTitle.  This is a simple example; 
  17109. to take a more complex instance, a handle to a window might have a variable 
  17110. name hMainWindow, which would differentiate it in the source code from a window 
  17111. procedure wpMainWindow or other data items relating to the window, while 
  17112. maintaining an indication of the relationship between the items by the 
  17113. similarity in their names. 
  17114.  
  17115. Prefixing variable names in this way has the additional advantage that a 
  17116. compiler cross-reference listing will group together all variables of the same 
  17117. data type.  Any redundancies may thus be seen at a glance. 
  17118.  
  17119. A pointer to a variable is indicated by using an additional prefix p before the 
  17120. prefix indicating the data type of the variable.  Some examples are shown in 
  17121. Table "Type Prefixes for Pointers". 
  17122.  
  17123. As a further example, an unsigned integer UserResponse might have a prefix of 
  17124. us making the variable name usUserResponse.  A pointer to this variable would 
  17125. have the name pusUserResponse.  The name thus indicates both the data type of 
  17126. the pointer and its relationship with the variable to which it points. 
  17127.  
  17128.  
  17129. ΓòÉΓòÉΓòÉ 30. Application Program Construction ΓòÉΓòÉΓòÉ
  17130.  
  17131. This section of the document presents guidelines for the structuring of 
  17132. applications and their component modules, in order to achieve the optimum level 
  17133. of modularity and granularity within an application.  The guidelines contained 
  17134. herein are particularly applicable to the C programming language, although they 
  17135. may also apply to other languages with similar structures. 
  17136.  
  17137.  
  17138. ΓòÉΓòÉΓòÉ 30.1. Modularization ΓòÉΓòÉΓòÉ
  17139.  
  17140. Within a Presentation Manager application, it is recommended that the 
  17141. application code be separated into distinct source modules, as follows: 
  17142.  
  17143.  Each window procedure (that is, application object) should be placed in its 
  17144.   own separate source module, along with functions and subroutines created for 
  17145.   and exclusively called by that window procedure.  This creates the situation 
  17146.   where a single window is contained per source module, which preserves 
  17147.   isolation and facilitates independence of application objects. 
  17148.  
  17149.  Type definitions, variable and constant declarations (including private 
  17150.   message classes) and function prototypes that are local to a particular 
  17151.   source module should be placed in a private header file or alternatively, 
  17152.   included in the source module itself. 
  17153.  
  17154.  Function prototypes for those window procedures or subroutines that will 
  17155.   become the entry points to the source module should be placed in a separate 
  17156.   header file, along with type definitions, variable and constant declarations 
  17157.   that will be required by other source modules calling those procedures or 
  17158.   subroutines.  This header file may then be referenced by each source module 
  17159.   that requires access to these procedures or routines.  This header file is 
  17160.   known as the public header file. 
  17161.  
  17162.  Global type definitions, variable and constant declarations should be placed 
  17163.   in a global header file that may be referenced by each source module.  In the 
  17164.   ideal case, global variables and constants should not be used by an 
  17165.   application, and this header file would therefore not be required. 
  17166.  
  17167.  Generic functions and subroutines accessed by more than one window procedure 
  17168.   should be placed in a separate source module with its own header file (known 
  17169.   as a generic routines header file), which may be referenced by each module 
  17170.   requiring access to the generic routines. This includes "functions" such as 
  17171.   dialog definitions and dialog procedures that are accessed from multiple 
  17172.   window procedures, and message handling routines. 
  17173.  
  17174.  Presentation Manager resources used by modules within an application should 
  17175.   be placed in a resource script file, and their associated identifiers defined 
  17176.   in the application's public header file. 
  17177.  
  17178. Note that a Workplace Shell object's source code is automatically partitioned 
  17179. in a similar manner to that described above, since the various files are 
  17180. created by the SOM Precompiler from the object's class definition file. 
  17181.  
  17182. Separation of the application code into its constituent application objects in 
  17183. this manner facilitates the isolation and independence of application objects, 
  17184. and enhances the potential for their subsequent reuse.  It also eases the task 
  17185. of application maintenance and change management, by effectively modularizing 
  17186. an application and therefore helping to contain the scope of change within a 
  17187. single source module and its dependent header files. 
  17188.  
  17189. The separation of header files into private, public and global definitions in 
  17190. the manner described above further enhances the independence of application 
  17191. objects and facilitates change management, in the following ways: 
  17192.  
  17193.  The separation of an application object's public interfaces means that other 
  17194.   application objects are aware only of those interfaces, and not of the 
  17195.   internal definitions and operations of the application object. Changes within 
  17196.   an application object, to local type, variable or constant definitions, do 
  17197.   not impact other application objects with which the changed object 
  17198.   communicates 
  17199.  
  17200.  The separation of the private and public interfaces explicitly defines each 
  17201.   of these interfaces, so that a maintenance programmer is clearly aware of 
  17202.   changes that will or will not impact other application objects.  Other 
  17203.   applications that do require modification as a result may be easily 
  17204.   identified, since their source modules will contain a reference to the 
  17205.   changed object's external interface header file. 
  17206.  
  17207. When managing the development of large projects, an "owner" should be appointed 
  17208. for each source module.  This owner is typically a member of the development 
  17209. team who bears responsibility for that module.  A module's owner should also 
  17210. have the responsibility for that module's private and public header files. 
  17211.  
  17212.  
  17213. ΓòÉΓòÉΓòÉ 30.2. Header Files ΓòÉΓòÉΓòÉ
  17214.  
  17215. Header files should be used wherever possible in order to isolate data and 
  17216. function declarations from the application code, thereby enhancing modularity 
  17217. and improving readability. 
  17218.  
  17219. For management purposes and to facilitate subsequent maintenance of the 
  17220. application code, a header file should include a prolog identifying the 
  17221. application and source module with which it is associated, its author and 
  17222. owner, and whether the header file is a private, public, global or generic 
  17223. header file (see below for definitions of these terms). 
  17224.  
  17225.  
  17226. ΓòÉΓòÉΓòÉ 30.2.1. Private Header File ΓòÉΓòÉΓòÉ
  17227.  
  17228. Each source module should have its own private header file, or have the 
  17229. contents of such a file included in the source module itself.  The private 
  17230. header file should itself include: 
  17231.  
  17232.  Declarations for all local constants used within the source module; that is, 
  17233.   those constants that are not accessed or referenced from outside the source 
  17234.   module.  This includes those application-defined message classes used by a 
  17235.   window procedure in indicating events to itself, or by dependent functions 
  17236.   and/or subroutines to indicate messages to their parent window procedure. 
  17237.  
  17238.  Declarations for all non-local variables used within the source module; that 
  17239.   is, those variables that are accessed from more than one routine within the 
  17240.   source module, but are not accessed from outside the source module. 
  17241.  
  17242.  Prototypes for all functions and subroutines that are accessed only from 
  17243.   within the source module. 
  17244.  
  17245. A private header file should be referenced, using an appropriate #include 
  17246. statement, only by its own source module. 
  17247.  
  17248.  
  17249. ΓòÉΓòÉΓòÉ 30.2.2. External Interface Header File ΓòÉΓòÉΓòÉ
  17250.  
  17251. Each source module should possess its own public header file.  The public 
  17252. header file should contain: 
  17253.  
  17254.  Function prototypes for the entry-point functions or subroutines within the 
  17255.   source module, and only for those routines.  This preserves the isolation of 
  17256.   the source module's internal workings from the calling application. 
  17257.  
  17258.  Type definitions for any application-defined data types required by the 
  17259.   entry-point functions or subroutines. 
  17260.  
  17261.  Message class definitions for application-defined message classes that will 
  17262.   be used to signal events to a window procedure within the source module. 
  17263.  
  17264. A public header file should be referenced by its own source module and by any 
  17265. other source module which requires access to the entry points of the module. 
  17266. In an ideal case, where optimum isolation is achieved by relating all 
  17267. processing within the source module to a single window, access to these entry 
  17268. points would be achieved by: 
  17269.  
  17270.  A single "conventional" subroutine call to create the window, with the caller 
  17271.   specifying appropriate parameters and the called routine returning a handle 
  17272.   to the window.  The public header file must therefore contain definitions for 
  17273.   any application-defined data types to be passed as parameters to this call. 
  17274.  
  17275.  Passing a series of messages to the window in order to indicate events and 
  17276.   request actions.  The public header file must therefore also contain 
  17277.   definitions for any application-defined message classes used by the window. 
  17278.  
  17279. Since the public header file contains the interfaces to its parent window (that 
  17280. is, application object) it should be carefully documented, and the entry points 
  17281. and their means of access should be placed in the application's design 
  17282. documentation.  Interfaces to those application objects that are identified as 
  17283. having potential for reuse should also be placed in an Interface Control 
  17284. Document from which they may be accessed for future reuse of the application 
  17285. object (see Packaging). 
  17286.  
  17287.  
  17288. ΓòÉΓòÉΓòÉ 30.2.3. Global Header File ΓòÉΓòÉΓòÉ
  17289.  
  17290. An application may contain a global header file, which itself should contain: 
  17291.  
  17292.  Declarations for all global constants used by the application; that is, those 
  17293.   constants that are accessed from more than one source module within the 
  17294.   application. 
  17295.  
  17296.  Declarations for all global variables used by the application; that is, those 
  17297.   variables that are accessed from more than one source module within the 
  17298.   application.  Note that this does not include those variables that are used 
  17299.   by multiple routines within the same source module. 
  17300.  
  17301. The global header file should be referenced, using an appropriate #include 
  17302. statement, by all source modules within the application, other than the 
  17303. module(s) containing generic routines. 
  17304.  
  17305.  
  17306. ΓòÉΓòÉΓòÉ 30.2.4. Generic Routines Header File ΓòÉΓòÉΓòÉ
  17307.  
  17308. One or more source modules in an application may contain generic routines that 
  17309. are accessed from multiple source modules within the application. These source 
  17310. modules may possess their own local header files to define data and functions 
  17311. accessed only from within their own module.  In addition, such source modules 
  17312. should possess a single generic routines header file per application, which 
  17313. should contain: 
  17314.  
  17315.  Prototypes for all generic functions and subroutines that will be accessed 
  17316.   from other source modules within the application 
  17317.  
  17318.  Declarations for data types and constants necessary to the invocation of 
  17319.   these generic routines. 
  17320.  
  17321. The generic routines header file should be referenced, via an appropriate 
  17322. #include statement, by its own source modules and by each source module within 
  17323. the application that requires access to generic routines. 
  17324.  
  17325.  
  17326. ΓòÉΓòÉΓòÉ 30.2.5. System-Supplied Header Files ΓòÉΓòÉΓòÉ
  17327.  
  17328. Source modules in an application will typically require access to operating 
  17329. system or C language functions.  Prototypes for these functions and 
  17330. declarations for their associated data types and constants are provided in 
  17331. system-supplied header files.  Examples of system-supplied header files are the 
  17332. OS/2 system functions file os2.h and the C language run-time library files such 
  17333. as stlib.h and string.h. 
  17334.  
  17335.  
  17336. ΓòÉΓòÉΓòÉ 30.3. Data Abstraction and Encapsulation ΓòÉΓòÉΓòÉ
  17337.  
  17338. In order to enhance reusability and to facilitate the containment (and 
  17339. therefore the management) of change, data definition and initialization should, 
  17340. wherever possible, be encapsulated within source modules as follows: 
  17341.  
  17342.  Local variables should be used wherever possible.  Where the value of a 
  17343.   variable must be held between invocations of the same function or subroutine, 
  17344.   the static keyword may be used in declaring the variable. 
  17345.  
  17346.  For window procedures where the values of variables must be held beyond the 
  17347.   scope of processing a single message, a memory object may be allocated for 
  17348.   the variable(s) and a pointer to that object stored in the window words of 
  17349.   the window. 
  17350.  
  17351.  External data objects such as files, databases, etc., should be defined and 
  17352.   accessed only from within a single window procedure and its dependent 
  17353.   functions and subroutines.  Definition of and/or establishment of access to 
  17354.   such data objects should be performed upon window creation as part of the 
  17355.   WM_CREATE message processing, and termination of access should be performed 
  17356.   upon window closure as part of the WM_CLOSE message processing. 
  17357.  
  17358.  The use of global variables should be avoided wherever possible, although it 
  17359.   is recognized that global variables are necessary in certain circumstances 
  17360.   within a Presentation Manager application.  Where global variables are to be 
  17361.   used, they should be declared in the application's main source module (that 
  17362.   is, the module that contains the application's main routine) and referenced 
  17363.   from the application's global header file using the extern keyword. 
  17364.  
  17365.  Except in the case noted above, the use of external variable declarations 
  17366.   using the extern keyword should be avoided wherever possible, since this 
  17367.   creates an interdependence between source modules (and therefore between 
  17368.   application objects) that may subsequently limit the potential for reuse of 
  17369.   those objects.  Variables should preferably be defined locally within a 
  17370.   source module or alternatively, defined globally and referenced in the 
  17371.   application's global header file. 
  17372.  
  17373.  Where non-local variables and/or constants (that is, variables and/or 
  17374.   constants that are accessed only from within a particular source module, but 
  17375.   are not local to any routine within that module) are declared, they should be 
  17376.   placed in that source module's private header file or, if the module does not 
  17377.   possess its own header file, placed at the beginning of the source module. 
  17378.  
  17379. The practice of maximizing the use of local and encapsulated data, and of 
  17380. minimizing and simplifying the external interfaces of application objects, will 
  17381. achieve the maximum level of isolation and therefore of independence between 
  17382. application objects, thus enhancing the potential for their reuse and 
  17383. facilitating their future maintenance by isolating their internal workings from 
  17384. those of other application objects. 
  17385.  
  17386.  
  17387. ΓòÉΓòÉΓòÉ 30.4. Packaging ΓòÉΓòÉΓòÉ
  17388.  
  17389. As already mentioned in Modularization, application code should be separated 
  17390. into distinct source modules.  These source modules are then compiled to 
  17391. produce individual object modules, which in turn are link-edited to produce 
  17392. executable code. However, the executable application code may itself consist of 
  17393. more than one executable module, by virtue of the dynamic linking capabilities 
  17394. of the OS/2 operating system. 
  17395.  
  17396.  
  17397. ΓòÉΓòÉΓòÉ 30.4.1. Application Object Modules ΓòÉΓòÉΓòÉ
  17398.  
  17399. If the foregoing guidelines are followed, each object module produced by the C 
  17400. language compiler will contain the following: 
  17401.  
  17402.  Definitions for all locally defined data types, variables and constants 
  17403.   required by routines within the module, obtained from the module's private 
  17404.   header file at compile time 
  17405.  
  17406.  Prototypes for all local window procedures, functions and subroutines 
  17407.   accessed only by routines within the module, obtained from the application's 
  17408.   private header file at compile time 
  17409.  
  17410.  Definitions for all external data structures, variables and constants 
  17411.   required to communicate with other source modules, obtained from one or more 
  17412.   public header files at compile time 
  17413.  
  17414.  Prototypes for all external window procedures, functions and subroutines 
  17415.   accessed by routines within the module, other than those that constitute 
  17416.   generic routines, obtained from one or more public header files at compile 
  17417.   time 
  17418.  
  17419.  Declarations for all global variables and constants required by routines 
  17420.   within the module, obtained from the application's global header file at 
  17421.   compile time 
  17422.  
  17423.  Prototypes for all generic routines, obtained from the application's generic 
  17424.   routines header file at compile time 
  17425.  
  17426.  Code for those routines contained within the module. 
  17427.  
  17428. Each object module therefore exists as a coherent identity in its own right, 
  17429. and ideally has no dependence upon other object modules, other than the need to 
  17430. communicate with and make use of window procedures, functions and subroutines 
  17431. contained within those modules, which is achieved through public interfaces 
  17432. that are clearly defined and documented.  The separation of source modules is 
  17433. now carried over to the object code, in that each object module represents a 
  17434. separate application object. 
  17435.  
  17436. It is therefore possible to assemble a number of object modules in various ways 
  17437. to achieve an executable application.  The following guidelines are offered for 
  17438. the construction of the executable application. 
  17439.  
  17440.  
  17441. ΓòÉΓòÉΓòÉ 30.4.2. Application Executable File ΓòÉΓòÉΓòÉ
  17442.  
  17443. The application's main executable file (that is, the file that is invoked to 
  17444. start the application) should contain those object modules which are required 
  17445. to execute the application, and that do not contain generic routines or generic 
  17446. Presentation Manager resources. 
  17447.  
  17448. Where it is envisaged that an application object is usable only by the current 
  17449. application, and has no possible potential for future reuse, it may be bound 
  17450. with the application's main executable file.  However, if such potential for 
  17451. reuse exists, the application object should be placed in a dynamic link 
  17452. library. 
  17453.  
  17454.  
  17455. ΓòÉΓòÉΓòÉ 30.4.3. Dynamic Link Libraries ΓòÉΓòÉΓòÉ
  17456.  
  17457. The following routines and objects should, wherever possible, be placed in 
  17458. dynamic link libraries: 
  17459.  
  17460.  Those application objects that have been identified as having potential for 
  17461.   future reuse by other applications 
  17462.  
  17463.  Those routines identified as generic routines, which will be accessed from 
  17464.   more than one window procedure 
  17465.  
  17466.  Those Presentation Manager resources (for example, dialog definitions, along 
  17467.   with their associated dialog procedures) that are accessed from multiple 
  17468.   window procedures within the application. 
  17469.  
  17470. The placement of such items in dynamic link libraries enhances their 
  17471. independence from the application's code, enabling changes to be made without 
  17472. affecting the code or requiring application maintenance.  In addition, 
  17473. placement in dynamic link libraries facilitates reuse of such items by multiple 
  17474. applications.  It is thus possible to achieve object code reuse at both the 
  17475. application object and at the subroutine level. 
  17476.  
  17477. To this end, all items placed in dynamic link libraries should have their 
  17478. external interfaces documented, baselined and included in an Interface Control 
  17479. Document, for subsequent use as development library routines.  It is the 
  17480. responsibility of the development organization to establish procedures for the 
  17481. testing and acceptance of reusable code modules into libraries from which they 
  17482. may subsequently be accessed by application developers, and the creation of a 
  17483. repository of documentation detailing the application objects that are 
  17484. available, their behavior and external interfaces. 
  17485.  
  17486.  
  17487. ΓòÉΓòÉΓòÉ 31. OS/2 Kernel API Functions ΓòÉΓòÉΓòÉ
  17488.  
  17489. This section of the document describes the functions that are available to 
  17490. application programs for accessing operating system services.  Note that only 
  17491. the operating system kernel functions are described in this section, since the 
  17492. Presentation Manager programming interface has not significantly changed, 
  17493. although a number of new Presentation Manager functions have been added. 
  17494.  
  17495. The following tables list the kernel functions available under OS/2 Version 1.3 
  17496. and their equivalent function under OS/2 Version 2.0, categorized by function 
  17497. area. 
  17498.  
  17499.  
  17500. ΓòÉΓòÉΓòÉ 31.1. Memory Allocation and Management ΓòÉΓòÉΓòÉ
  17501.  
  17502. Memory management under OS/2 Version 2.0 is greatly simplified through use of 
  17503. the 32-bit flat memory model, eliminating the need for applications to create 
  17504. and manipulate separate memory segments. 
  17505.  
  17506. Table "Memory Management Functions" 
  17507.  
  17508.  
  17509. ΓòÉΓòÉΓòÉ 31.2. Session Management ΓòÉΓòÉΓòÉ
  17510.  
  17511. There are few changes in session management functions between OS/2 Version 1.3 
  17512. and OS/2 Version 2.0.  Only the DosSMRegisterDD() function has been removed 
  17513. from OS/2 Version 2.0. 
  17514.  
  17515. Table "Session Management Functions" 
  17516.  
  17517.  
  17518. ΓòÉΓòÉΓòÉ 31.3. Task Management ΓòÉΓòÉΓòÉ
  17519.  
  17520. A number of function names have changed in the task management area.  These 
  17521. changes are primarily due to the simplified 32-bit programming environment. 
  17522.  
  17523. Table "Task Management Functions" 
  17524.  
  17525. The following comments apply to the functions described in Table "Task 
  17526. Management Functions": 
  17527.  
  17528.  The DosCreateThread() function is enhanced in Version 2.0 to allow dynamic 
  17529.   stack growth, operating system management of stacks for secondary threads, 
  17530.   and the ability to create a suspended thread. 
  17531.  
  17532.  The InfoSeg architecture of 16-bit OS/2 versions is redefined for the flat 
  17533.   memory model.  The equivalent per thread and per process data is obtained 
  17534.   under Version 2.0 using the DosGetInfoBlocks() function, whereas the 
  17535.   non-changing values can be obtained using the DosQuerySysInfo() function. 
  17536.  
  17537.  The DosGetPrty(), DosGetPID(), and DosGetPPID() functions are not implemented 
  17538.   since this information is available through the DosGetInfoBlocks() function. 
  17539.  
  17540.  DosPTrace() support is provided under OS/2 Version 2.0 for 16-bit debugging 
  17541.   tools such as CodeView.  For 32-bit debugging tools, the DosPTrace() function 
  17542.   is replaced by the DosDebug() function. 
  17543.  
  17544.  DosWaitThread() is a new function allowing a thread to suspend itself, 
  17545.   waiting for other threads within a process to terminate. 
  17546.  
  17547.  DosKillThread() is a new function allowing a thread to forcibly terminate 
  17548.   another thread within the current process. 
  17549.  
  17550.  The DosR2StackRealloc(), DosCallBack(), and DosRetForward() functions are not 
  17551.   applicable in the 32-bit flat memory model environment. 
  17552.  
  17553.  
  17554. ΓòÉΓòÉΓòÉ 31.4. Signal and Exception Handling ΓòÉΓòÉΓòÉ
  17555.  
  17556. OS/2 Version 2.0 removes the function handling signals and combines signal 
  17557. handling with hardware exception handling, providing a more unified approach 
  17558. that allows greater flexibility. 
  17559.  
  17560. Table "Exception Handling Functions" 
  17561.  
  17562. The DosSetKBDSigFocus() function is used to allow 32-bit programs to inform the 
  17563. operating system that they are "primed for signals", although the signals are 
  17564. dispatched as exceptions. 
  17565.  
  17566. Note the following: 
  17567.  
  17568.  16-bit DosSetVec() exceptions are supported under OS/2 Version 2.0. 
  17569.  
  17570.  The 32-bit OS/2 Version 2.0 exception manager allows per-thread exception 
  17571.   handling. 
  17572.  
  17573.  OS/2 Version 2.0 does not allow an exception handler to be registeed for the 
  17574.   numeric processor exception (NPX). 
  17575.  
  17576.  
  17577. ΓòÉΓòÉΓòÉ 31.5. Interprocess Communication ΓòÉΓòÉΓòÉ
  17578.  
  17579. OS/2 Version 2.0 provides the same interprocess communication and 
  17580. synchronization facilities as OS/2 Version 1.3.  Differences in functions used 
  17581. to invoke these facilities are shown in the following tables. 
  17582.  
  17583.  
  17584. ΓòÉΓòÉΓòÉ 31.5.1. Anonymous Pipes ΓòÉΓòÉΓòÉ
  17585.  
  17586. The name of the DosMakePipe() function has been changed to DosCreatePipe() to 
  17587. conform with the consistent naming rules introduced in OS/2 Version 2.0. 
  17588.  
  17589. Table "Anonymous Pipe Functions" 
  17590.  
  17591. Other functions used to access anonymous pipes are basic file I/O functions, 
  17592. and are described in File I/O. 
  17593.  
  17594.  
  17595. ΓòÉΓòÉΓòÉ 31.5.2. Named Pipes ΓòÉΓòÉΓòÉ
  17596.  
  17597. Changes to the functions used to create and manipulate named pipes have been 
  17598. made in order to conform to the consistent naming rules introduced in OS/2 
  17599. Version 2.0. 
  17600.  
  17601. Table "Named Pipe Functions" 
  17602.  
  17603.  
  17604. ΓòÉΓòÉΓòÉ 31.5.3. Queues ΓòÉΓòÉΓòÉ
  17605.  
  17606. No changes have been made to function names for queue manipulation between the 
  17607. OS/2 Version 1.3 and OS/2 Version 2.0 implementations. 
  17608.  
  17609. Table "Queue Functions" 
  17610.  
  17611. The queueing functions for the 16-bit and 32-bit environments are virtually 
  17612. identical; the only difference is that the 32-bit API uses 0:32 addressing and 
  17613. may use element sizes greater than 64KB.  Note that a a 32-bit application may 
  17614. not open a queue created by a 16-bit application using the 16-bit 
  17615. DosCreateQueue() function. 
  17616.  
  17617.  
  17618. ΓòÉΓòÉΓòÉ 31.5.4. Semaphores ΓòÉΓòÉΓòÉ
  17619.  
  17620. Significant changes have been made to semaphore functions under OS/2 Version 
  17621. 2.0, in order to provide additional flexibility and enhance the architectural 
  17622. independence of applications using semaphores. 
  17623.  
  17624. Table "Semaphore Functions" 
  17625.  
  17626. OS/2 Version 2.0 provides 16-bit entry points allowing compatibility with 
  17627. 16-bit applications that use the old system semaphores, RAM semaphores and Fast 
  17628. Safe RAM (FSR) semaphores. 
  17629.  
  17630.  
  17631. ΓòÉΓòÉΓòÉ 31.6. Message Retrieval ΓòÉΓòÉΓòÉ
  17632.  
  17633. Few changes have been made to the kernel message retrieval functions.  Only the 
  17634. name of the DosInsMessage() function has been changed to DosInsertMessage() in 
  17635. order to conform with the consistent naming rules introduced in OS/2 Version 
  17636. 2.0. 
  17637.  
  17638. Table "Message Retrieval Functions" 
  17639.  
  17640.  
  17641. ΓòÉΓòÉΓòÉ 31.7. Timer Services ΓòÉΓòÉΓòÉ
  17642.  
  17643. A number of timer function names have changed under OS/2 Version 2.0, in order 
  17644. to conform to the consistent naming rules introduced in OS/2 Version 2.0. 
  17645.  
  17646. Table "Timer Services Functions" 
  17647.  
  17648.  
  17649. ΓòÉΓòÉΓòÉ 31.8. Dynamic Linking ΓòÉΓòÉΓòÉ
  17650.  
  17651. A number of dynamic linking function names have been changed in order to 
  17652. conform to the consistent naming rules introduced in OS/2 Version 2.0. 
  17653.  
  17654. Table "Dynamic Linking Functions" 
  17655.  
  17656.  
  17657. ΓòÉΓòÉΓòÉ 31.9. Device I/O ΓòÉΓòÉΓòÉ
  17658.  
  17659. No changes have been made to device I/O functions under OS/2 Version 2.0. 
  17660.  
  17661. Table "Device I/O Functions" 
  17662.  
  17663.  
  17664. ΓòÉΓòÉΓòÉ 31.10. File I/O ΓòÉΓòÉΓòÉ
  17665.  
  17666. A number of changes have been made to file I/O functions, in order to conform 
  17667. to the consistent naming rules introduced in OS/2 Version 2.0. 
  17668.  
  17669. Table "File I/O Functions" 
  17670.  
  17671.  
  17672. ΓòÉΓòÉΓòÉ 31.11. Code Page Support ΓòÉΓòÉΓòÉ
  17673.  
  17674. Code page support has been simplified under OS/2 Version 2.0, and a number of 
  17675. function names have been changed to conform to the consistent naming rules 
  17676. introduced in Version 2.0. 
  17677.  
  17678. Table "Code Page Functions" 
  17679.  
  17680. The DosSetCp() function is no longer implemented, since under OS/2 Version 2.0 
  17681. an application may only set the code page for its own process, using the 
  17682. DosSetProcessCp() function. 
  17683.  
  17684. The DosCaseMap() function is no longer implemented since the same task is 
  17685. performed by the WinUpper() function. 
  17686.  
  17687.  
  17688. ΓòÉΓòÉΓòÉ 31.12. Error Management ΓòÉΓòÉΓòÉ
  17689.  
  17690. No changes have been made to error management functions under OS/2 Version 2.0. 
  17691.  
  17692. Table "Error Management Functions" 
  17693.  
  17694.  
  17695. ΓòÉΓòÉΓòÉ 32. Problem Reporting Worksheet ΓòÉΓòÉΓòÉ
  17696.  
  17697. The following section contains a worksheet that may be used for reporting 
  17698. problems encountered during application testing.  This worksheet follows the 
  17699. guidelines given in Problem Determination, and requires the application user to 
  17700. complete the following information: 
  17701.  
  17702.  The name of the application.  This is necessary in order that developers may 
  17703.   search for the error in the correct program. 
  17704.  
  17705.  The title of the active window when the error occurred.  This is necessary in 
  17706.   order to identify the window procedure in which the problem most likely 
  17707.   resides. 
  17708.  
  17709.  The title of the last user action prior to the error occurring.  This is 
  17710.   required in order to identify the Presentation Manager message that is likely 
  17711.   to have caused the error; it is probable that the problem lies in the 
  17712.   processing for this message. 
  17713.  
  17714.  Whether the action was attempted for the first time, or whether the action 
  17715.   had already been successfully completed one or more times during the current 
  17716.   execution of the application.  This indicates whether the problem is probably 
  17717.   a resource allocation error, or whether another cause is more likely. 
  17718.  
  17719.  A description of the error, including an error message if one was provided by 
  17720.   the application, Presentation Manager or the operating system. 
  17721.  
  17722.  The name of the user who discovered the error, along with a telephone number 
  17723.   for future contact if any clarification is required. 
  17724.  
  17725.  The date and time at which the error occurred.  While not necessary from a 
  17726.   problem determination viewpoint, this information allows a problem management 
  17727.   coordinator to monitor the amount of time necessary to respond to and rectify 
  17728.   application problems, and therefore allows management to determine the 
  17729.   effectiveness of the testing and debugging process. 
  17730.  
  17731. The worksheet also contains a space at the foot of the page, into which readers 
  17732. may insert the name of the person responsible for coordinating problem 
  17733. determination and resolution activities, and to whom completed worksheets 
  17734. should be sent.  This person would then typically allocate the isolation, 
  17735. diagnosis and resolution of problems to specific developers. 
  17736.  
  17737. For a more complete description of Presentation Manager problem determination 
  17738. procedures, readers should refer to Problem Determination. 
  17739.  
  17740. Readers may photocopy the worksheet on the following page, insert the name of 
  17741. the appropriate coordinator, and distribute the worksheet within their 
  17742. organizations for problem-reporting purposes. 
  17743.  
  17744.  
  17745. ΓòÉΓòÉΓòÉ 32.1. Problem Reporting Worksheet. ΓòÉΓòÉΓòÉ
  17746.  
  17747. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  17748. Γöé                           PROBLEM REPORTING WORKSHEET                        Γöé
  17749. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17750. Γöé This worksheet is to be completed by application testers, for all problems   Γöé
  17751. Γöé encountered during testing of Presentation Manager applications.             Γöé
  17752. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17753. Γöé APPLICATION:  What was the name of the application you were running          Γöé
  17754. Γöé when the error occurred?                                                     Γöé
  17755. Γöé                                                                              Γöé
  17756. Γöé                                                                              Γöé
  17757. Γöé                                                                              Γöé
  17758. Γöé                                                                              Γöé
  17759. Γöé                                                                              Γöé
  17760. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17761. Γöé WINDOW: What was the title of the window you were accessing when the         Γöé
  17762. Γöé error occurred?                                                              Γöé
  17763. Γöé                                                                              Γöé
  17764. Γöé                                                                              Γöé
  17765. Γöé                                                                              Γöé
  17766. Γöé                                                                              Γöé
  17767. Γöé                                                                              Γöé
  17768. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17769. Γöé ACTION:  What was the last action bar entry or accelerator key               Γöé
  17770. Γöé combination you selected?                                                    Γöé
  17771. Γöé                                                                              Γöé
  17772. Γöé                                                                              Γöé
  17773. Γöé                                                                              Γöé
  17774. Γöé                                                                              Γöé
  17775. Γöé                                                                              Γöé
  17776. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17777. Γöé [ ] First time action was attempted    Γöé [_] Action was repeated multiple    Γöé
  17778. Γöé                                        Γöé times                               Γöé
  17779. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17780. Γöé ERROR DESCRIPTION:  Provide a description of the error, including the        Γöé
  17781. Γöé error message if one was displayed.                                          Γöé
  17782. Γöé                                                                              Γöé
  17783. Γöé                                                                              Γöé
  17784. Γöé                                                                              Γöé
  17785. Γöé                                                                              Γöé
  17786. Γöé                                                                              Γöé
  17787. Γöé                                                                              Γöé
  17788. Γöé                                                                              Γöé
  17789. Γöé                                                                              Γöé
  17790. Γöé                                                                              Γöé
  17791. Γöé                                                                              Γöé
  17792. Γöé                                                                              Γöé
  17793. Γöé                                                                              Γöé
  17794. Γöé                                                                              Γöé
  17795. Γöé                                                                              Γöé
  17796. Γöé                                                                              Γöé
  17797. Γöé                                                                              Γöé
  17798. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17799. Γöé REPORTED BY   Γöé Name:                                          Γöé Ext:        Γöé
  17800. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17801. Γöé Include the date/time at which the error       Γöé Date:         Γöé Time:       Γöé
  17802. Γöé occurred                                       Γöé               Γöé             Γöé
  17803. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17804. Γöé When completed, please forward this worksheet to:                            Γöé
  17805. Γöé                                                                              Γöé
  17806. Γöé                                                                              Γöé
  17807. Γöé                                                                              Γöé
  17808. Γöé                                                                              Γöé
  17809. Γöé                                                                              Γöé
  17810. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  17811.  
  17812.  
  17813. ΓòÉΓòÉΓòÉ 33. Glossary ΓòÉΓòÉΓòÉ
  17814.  
  17815.  
  17816. ΓòÉΓòÉΓòÉ 33.1. ACDI ΓòÉΓòÉΓòÉ
  17817.  
  17818. ACDI 
  17819.  
  17820. Asynchronous Communication Device Interface;  programming interface which 
  17821. supports device-independent communication between devices on an asynchronous 
  17822. communications link.  ACDI is supported by OS/2 Extended Edition Version 1.x, 
  17823. OS/2 Extended Services, and by a number of other hardware and software vendors. 
  17824.  
  17825.  
  17826. ΓòÉΓòÉΓòÉ 33.2. action ΓòÉΓòÉΓòÉ
  17827.  
  17828. action 
  17829.  
  17830. A user-specified operation that is applied to an object. 
  17831.  
  17832.  
  17833. ΓòÉΓòÉΓòÉ 33.3. action window ΓòÉΓòÉΓòÉ
  17834.  
  17835. action window 
  17836.  
  17837. Term used in SAA CUA'91 documentation to refer to a short-lived window used to 
  17838. display information and receive input from the user in a structured dialog 
  17839. format.  The information is typically related to a particular action being 
  17840. performed by the application.  Implemented in Presentation Manager using a 
  17841. dialog box. 
  17842.  
  17843.  
  17844. ΓòÉΓòÉΓòÉ 33.4. address conversion ΓòÉΓòÉΓòÉ
  17845.  
  17846. address conversion 
  17847.  
  17848. The process of converting a 0:32 memory reference to a 16:16 memory reference, 
  17849. and vice versa.  Part of thunking. 
  17850.  
  17851.  
  17852. ΓòÉΓòÉΓòÉ 33.5. address translation ΓòÉΓòÉΓòÉ
  17853.  
  17854. address translation 
  17855.  
  17856. (1) The process of resolving a 0:32 memory reference into a physical memory 
  17857. address.  When using the paged memory option in the 80386 processor, a memory 
  17858. pointer passed by an application consists of Page Directory and Page Table 
  17859. entries, and an offset within a physical page.  This is resolved by the 
  17860. processor into a 32-bit physical memory address.  The validity and legality of 
  17861. the memory reference is also checked during the translation process, and a 
  17862. general protection exception is generated if necessary.  (2) The process of 
  17863. resolving a 16:16 memory reference into a physical memory address using a 
  17864. process's local descriptor table.  The validity and legality of the memory 
  17865. reference is also checked during the translation process, and a general 
  17866. protection exception is generated if necessary. 
  17867.  
  17868.  
  17869. ΓòÉΓòÉΓòÉ 33.6. ancestor ΓòÉΓòÉΓòÉ
  17870.  
  17871. ancestor 
  17872.  
  17873. Term used in Workplace Shell programming to refer to any object class from 
  17874. which a new object class inherits methods and/or data.  An ancestor may be the 
  17875. parent of the new object class, a parent of the parent, etc.  See also 
  17876. descendant. 
  17877.  
  17878.  
  17879. ΓòÉΓòÉΓòÉ 33.7. API ΓòÉΓòÉΓòÉ
  17880.  
  17881. API 
  17882.  
  17883. Application Programming Interface; term used to described the set of functions 
  17884. provided by which an application may gain access to operating system services. 
  17885.  
  17886.  
  17887. ΓòÉΓòÉΓòÉ 33.8. APPC ΓòÉΓòÉΓòÉ
  17888.  
  17889. APPC 
  17890.  
  17891. Advanced Program-to-Program Communication; programming interface for peer-level 
  17892. communication between applications over an SNA LU6.2 communications link.  APPC 
  17893. is supported in the PWS under DOS (using the APPC/PC product), and under OS/2 
  17894. Extended Edition Version 1.x and OS/2 Extended Services using the 
  17895. Communications Manager.  It is also supported in AS/400 systems and in 
  17896. System/370 hosts running VM/CMS and CICS. 
  17897.  
  17898.  
  17899. ΓòÉΓòÉΓòÉ 33.9. application-controlled viewport ΓòÉΓòÉΓòÉ
  17900.  
  17901. application-controlled viewport 
  17902.  
  17903. Viewport within a help window or online document window, where the display of 
  17904. information within that viewport is controlled by an application, which is 
  17905. specified by the developer of the source information.  Application-controlled 
  17906. viewports may be used to display image, video or other types of information 
  17907. under the control of the Information Presentation Facility.  See also 
  17908. IPF-controlled viewport. 
  17909.  
  17910.  
  17911. ΓòÉΓòÉΓòÉ 33.10. application-modal ΓòÉΓòÉΓòÉ
  17912.  
  17913. application-modal 
  17914.  
  17915. Term used to describe a message box or dialog box for which processing must be 
  17916. completed before further interaction with any other window owned by the same 
  17917. application may take place.  Interaction with windows owned by other 
  17918. applications is unaffected. 
  17919.  
  17920.  
  17921. ΓòÉΓòÉΓòÉ 33.11. application object ΓòÉΓòÉΓòÉ
  17922.  
  17923. application object 
  17924.  
  17925. An object consisting of a particular representation of a data entity, along 
  17926. with its associated methods; the term is used in this document for clarity, in 
  17927. order to differentiate the concept from that of a data object. 
  17928.  
  17929.  
  17930. ΓòÉΓòÉΓòÉ 33.12. application resource ΓòÉΓòÉΓòÉ
  17931.  
  17932. application resource 
  17933.  
  17934. Term used to describe a development resource that is application-specific. 
  17935. Such resources include source code modules and dynamic link libraries that will 
  17936. be used by only a single application. 
  17937.  
  17938.  
  17939. ΓòÉΓòÉΓòÉ 33.13. ASCII ΓòÉΓòÉΓòÉ
  17940.  
  17941. ASCII 
  17942.  
  17943. American Standard Code for Information Interchange; system which defines a 
  17944. standard for the representation of alphanumeric information within computer 
  17945. systems. 
  17946.  
  17947.  
  17948. ΓòÉΓòÉΓòÉ 33.14. asynchronous processing ΓòÉΓòÉΓòÉ
  17949.  
  17950. asynchronous processing 
  17951.  
  17952. Invocation of another procedure whereby that procedure is dispatched as a 
  17953. separate thread of execution, independent of the caller.  Control returns to 
  17954. the caller as soon as dispatching is complete; the caller may then continue 
  17955. execution without waiting for the dispatched procedure to complete its 
  17956. processing.  Asynchronous processing enables a Presentation Manager application 
  17957. to preserve the user responsiveness goals laid down by Common User Access 
  17958. guidelines, by executing lengthy operations as separate threads of execution. 
  17959.  
  17960.  
  17961. ΓòÉΓòÉΓòÉ 33.15. baselining ΓòÉΓòÉΓòÉ
  17962.  
  17963. baselining 
  17964.  
  17965. Process of establishing that a user-level application resource passes defined 
  17966. unit testing criteria before being promoted to production level.  See also 
  17967. promotion and production-level. 
  17968.  
  17969.  
  17970. ΓòÉΓòÉΓòÉ 33.16. base storage class ΓòÉΓòÉΓòÉ
  17971.  
  17972. base storage class 
  17973.  
  17974. Term used to describe the three System Object Model object classes that form 
  17975. the basis of the inheritance hierarchy implemented by the Workplace Shell. 
  17976.  
  17977.  
  17978. ΓòÉΓòÉΓòÉ 33.17. bit ΓòÉΓòÉΓòÉ
  17979.  
  17980. bit 
  17981.  
  17982. A binary digit, which may have a value of either zero or one.  Bits are 
  17983. represented within a computing device by the presence or absence of an 
  17984. electrical or magnetic pulse at a particular point, indicating a one or zero 
  17985. respectively. 
  17986.  
  17987.  
  17988. ΓòÉΓòÉΓòÉ 33.18. byte ΓòÉΓòÉΓòÉ
  17989.  
  17990. byte 
  17991.  
  17992. A logical data unit composed on eight binary digits (bits). 
  17993.  
  17994.  
  17995. ΓòÉΓòÉΓòÉ 33.19. CASE ΓòÉΓòÉΓòÉ
  17996.  
  17997. CASE 
  17998.  
  17999. Computer Aided Software Engineering; term used to describe the concept of 
  18000. automated application design and code generation, based upon a set of 
  18001. requirements entered by a user.  Products that implement CASE concepts are 
  18002. known as CASE tools. 
  18003.  
  18004.  
  18005. ΓòÉΓòÉΓòÉ 33.20. cdecl ΓòÉΓòÉΓòÉ
  18006.  
  18007. cdecl 
  18008.  
  18009. Linkage convention used in 16-bit "C" language programming under the IBM C/2 
  18010. compiler, which causes the compiler to generate object code for a function or 
  18011. subroutine, such that parameters are placed on the stack in right-to-left order 
  18012. when the subroutine is called, and the calling routine clears the stack after 
  18013. control is returned.  This is the default for "C" programs.  Contrast with 
  18014. pascal linkage convention. 
  18015.  
  18016.  
  18017. ΓòÉΓòÉΓòÉ 33.21. checkout ΓòÉΓòÉΓòÉ
  18018.  
  18019. checkout 
  18020.  
  18021. Process of recording the drawdown of an application resource by a developer for 
  18022. modification. 
  18023.  
  18024.  
  18025. ΓòÉΓòÉΓòÉ 33.22. child window ΓòÉΓòÉΓòÉ
  18026.  
  18027. child window 
  18028.  
  18029. A window that resides wholly within another window, known as its parent window, 
  18030. and that is restricted to the boundaries of the parent window. 
  18031.  
  18032.  
  18033. ΓòÉΓòÉΓòÉ 33.23. class-based ΓòÉΓòÉΓòÉ
  18034.  
  18035. class-based 
  18036.  
  18037. Term used to describe an implementation of object-oriented programming, whereby 
  18038. object classes are defined in terms of other, previously-defined object 
  18039. classes; the new class takes on the properties and methods of the existing 
  18040. class or classes, in accordance with the principle of inheritance.  The various 
  18041. dependencies thus formed constitute an inheritance hierarchy.  Such an approach 
  18042. facilitates the creation of new object classes with minimal effort, but at the 
  18043. expense of increased interdependence and reduced object granularity.  Compare 
  18044. with module-based approach. 
  18045.  
  18046.  
  18047. ΓòÉΓòÉΓòÉ 33.24. class data ΓòÉΓòÉΓòÉ
  18048.  
  18049. class data 
  18050.  
  18051. Data item for which the definition and contents are determined for an entire 
  18052. object class rather than an individual instance of that class; contrast with 
  18053. instance data. 
  18054.  
  18055.  
  18056. ΓòÉΓòÉΓòÉ 33.25. class definition file ΓòÉΓòÉΓòÉ
  18057.  
  18058. class definition file 
  18059.  
  18060. ASCII file that defines the characteristics of a Workplace Shell object class; 
  18061. used as input to the SOM Precompiler. 
  18062.  
  18063.  
  18064. ΓòÉΓòÉΓòÉ 33.26. client area ΓòÉΓòÉΓòÉ
  18065.  
  18066. client area 
  18067.  
  18068. See client window. 
  18069.  
  18070.  
  18071. ΓòÉΓòÉΓòÉ 33.27. client-server ΓòÉΓòÉΓòÉ
  18072.  
  18073. client-server 
  18074.  
  18075. Term used to describe an application architecture whereby an application module 
  18076. (the server) accepts requests from a number of other application modules (the 
  18077. clients) and performs actions on behalf of these clients.  Presentation Manager 
  18078. applications may be designed in such a way as to embody a client-server 
  18079. architecture. 
  18080.  
  18081.  
  18082. ΓòÉΓòÉΓòÉ 33.28. client window ΓòÉΓòÉΓòÉ
  18083.  
  18084. client window 
  18085.  
  18086. The area within a window that is used by an application to display information. 
  18087. The client window is actually a child window of the frame window within which 
  18088. it resides. 
  18089.  
  18090.  
  18091. ΓòÉΓòÉΓòÉ 33.29. Common Programming Interface ΓòÉΓòÉΓòÉ
  18092.  
  18093. Common Programming Interface 
  18094.  
  18095. Component of Systems Application Architecture that defines a set of programming 
  18096. languages and interfaces. 
  18097.  
  18098.  
  18099. ΓòÉΓòÉΓòÉ 33.30. Common User Access ΓòÉΓòÉΓòÉ
  18100.  
  18101. Common User Access 
  18102.  
  18103. Common User Access;  component of Systems Application Architecture that 
  18104. comprises a set of guidelines for defining user interface elements of an 
  18105. application. CUA includes such items as screen layout, PF key usage, etc. 
  18106.  
  18107.  
  18108. ΓòÉΓòÉΓòÉ 33.31. compatability region ΓòÉΓòÉΓòÉ
  18109.  
  18110. compatability region 
  18111.  
  18112. In the OS/2 Version 2.0 flat memory model, the address region below 512 MB, 
  18113. which may be addressed by a 16-bit application using the 16:16 addressing 
  18114. scheme.  Under OS/2 Version 2.0, this region is equivalent in size to the 
  18115. process address space. 
  18116.  
  18117.  
  18118. ΓòÉΓòÉΓòÉ 33.32. compatability region mapping algorithm ΓòÉΓòÉΓòÉ
  18119.  
  18120. compatability region mapping algorithm 
  18121.  
  18122. Algorithm used to perform address translation between 16:16 and 0:32 addressing 
  18123. schemes.  See also thunking. 
  18124.  
  18125.  
  18126. ΓòÉΓòÉΓòÉ 33.33. complex viewport ΓòÉΓòÉΓòÉ
  18127.  
  18128. complex viewport 
  18129.  
  18130. Term used to describe the creation of multiple viewports within the same help 
  18131. window or online document window, with separate formatting and scrolling 
  18132. characteristics.  For example, one viewport may contain a bitmap, while another 
  18133. contains supporting text.  The text viewport may be scrolled, while the other 
  18134. viewport containing the bitmap remains constant in the window.  See also simple 
  18135. viewport. 
  18136.  
  18137.  
  18138. ΓòÉΓòÉΓòÉ 33.34. context switching ΓòÉΓòÉΓòÉ
  18139.  
  18140. context switching 
  18141.  
  18142. In a multitasking operating system, the act of halting a currently executing 
  18143. task, saving its task state, and loading and dispatching a new task.  Note that 
  18144. OS/2 undertakes context switching on the basis of threads rather than 
  18145. hardware-defined tasks. 
  18146.  
  18147.  
  18148. ΓòÉΓòÉΓòÉ 33.35. control ΓòÉΓòÉΓòÉ
  18149.  
  18150. control 
  18151.  
  18152. See control window. 
  18153.  
  18154.  
  18155. ΓòÉΓòÉΓòÉ 33.36. Control Panel ΓòÉΓòÉΓòÉ
  18156.  
  18157. Control Panel 
  18158.  
  18159. Application provided by the OS/2 Presentation Manager user shell, which allows 
  18160. a user to set and customize various system parameters and attributes such as 
  18161. screen colors, default printer settings, etc. 
  18162.  
  18163.  
  18164. ΓòÉΓòÉΓòÉ 33.37. control window ΓòÉΓòÉΓòÉ
  18165.  
  18166. control window 
  18167.  
  18168. A specialized window created for a specific purpose, such as a text entry 
  18169. field, a push button or a list box.  The general concept of control windows 
  18170. also includes children of the frame window such as the title bar, menu bar and 
  18171. system, minimize and maximize icons.  Also known simply as a control. 
  18172.  
  18173.  
  18174. ΓòÉΓòÉΓòÉ 33.38. cooperative multitasking ΓòÉΓòÉΓòÉ
  18175.  
  18176. cooperative multitasking 
  18177.  
  18178. Multitasking implementation whereby applications executing in the system must 
  18179. voluntarily relinquish control of the processor in order to allow another task 
  18180. to execute.  Cooperative multitasking is typically less reliable than 
  18181. pre-emptive multitasking, and results in lower system throughput. 
  18182.  
  18183.  
  18184. ΓòÉΓòÉΓòÉ 33.39. CPI ΓòÉΓòÉΓòÉ
  18185.  
  18186. CPI 
  18187.  
  18188. See Common Programming Interface. 
  18189.  
  18190.  
  18191. ΓòÉΓòÉΓòÉ 33.40. CRMA ΓòÉΓòÉΓòÉ
  18192.  
  18193. CRMA 
  18194.  
  18195. See compatability region mapping algorithm. 
  18196.  
  18197.  
  18198. ΓòÉΓòÉΓòÉ 33.41. CUA ΓòÉΓòÉΓòÉ
  18199.  
  18200. CUA 
  18201.  
  18202. See Common User Access. 
  18203.  
  18204.  
  18205. ΓòÉΓòÉΓòÉ 33.42. DASD ΓòÉΓòÉΓòÉ
  18206.  
  18207. DASD 
  18208.  
  18209. Direct Access Storage Device; in traditional personal computer parlance, a 
  18210. fixed disk drive. 
  18211.  
  18212.  
  18213. ΓòÉΓòÉΓòÉ 33.43. data object ΓòÉΓòÉΓòÉ
  18214.  
  18215. data object 
  18216.  
  18217. A specific representation of a logical data entity; for example, the same 
  18218. logical data entity may exist both in memory and on a disk file. These 
  18219. representations are considered to be distinct data objects.  See also 
  18220. application object. 
  18221.  
  18222.  
  18223. ΓòÉΓòÉΓòÉ 33.44. descendant ΓòÉΓòÉΓòÉ
  18224.  
  18225. descendant 
  18226.  
  18227. Term used in Workplace Shell programming to denote any object class which 
  18228. inherits methods and/or data from the current object class.  See also ancestor. 
  18229.  
  18230.  
  18231. ΓòÉΓòÉΓòÉ 33.45. desktop ΓòÉΓòÉΓòÉ
  18232.  
  18233. desktop 
  18234.  
  18235. The screen background in the OS/2 Presentation Manager environment, upon which 
  18236. windows are displayed. 
  18237.  
  18238.  
  18239. ΓòÉΓòÉΓòÉ 33.46. development resource ΓòÉΓòÉΓòÉ
  18240.  
  18241. development resource 
  18242.  
  18243. Identifiable component of an application, such as a source code module, dynamic 
  18244. link library, Presentation Manager icon, etc;  alternatively, a utility or tool 
  18245. used to develop an application, such as a compiler, link-editor or programmers' 
  18246. toolkit. 
  18247.  
  18248.  
  18249. ΓòÉΓòÉΓòÉ 33.47. dialog ΓòÉΓòÉΓòÉ
  18250.  
  18251. dialog 
  18252.  
  18253. An interaction between an application and a user, based upon the need to 
  18254. achieve a single logical task, such as the opening of a file. 
  18255.  
  18256.  
  18257. ΓòÉΓòÉΓòÉ 33.48. dialog box ΓòÉΓòÉΓòÉ
  18258.  
  18259. dialog box 
  18260.  
  18261. A special, short-lived window created by an OS/2 Presentation Manager 
  18262. application to display information and receive input from the user in a 
  18263. structured dialog format.  The information is typically related to a particular 
  18264. action being performed by the application. 
  18265.  
  18266.  
  18267. ΓòÉΓòÉΓòÉ 33.49. Dialog Box Editor ΓòÉΓòÉΓòÉ
  18268.  
  18269. Dialog Box Editor 
  18270.  
  18271. Utility application provided with the IBM Developer's Toolkit for OS/2 2.0, 
  18272. which allows the design and creation of templates for dialog boxes. 
  18273.  
  18274.  
  18275. ΓòÉΓòÉΓòÉ 33.50. dialog procedure ΓòÉΓòÉΓòÉ
  18276.  
  18277. dialog procedure 
  18278.  
  18279. Special case of a window procedure; associated with a dialog box rather than a 
  18280. standard window. 
  18281.  
  18282.  
  18283. ΓòÉΓòÉΓòÉ 33.51. direct manipulation ΓòÉΓòÉΓòÉ
  18284.  
  18285. direct manipulation 
  18286.  
  18287. User interface technique whereby application functions are initiated by the 
  18288. user manipulating objects, represented by icons, on the Presentation Manager or 
  18289. Workplace Shell desktop.  The user typically initiates an action by selecting 
  18290. an icon, pressing and holding down a mouse button while "dragging" the icon 
  18291. over another object's icon on the desktop.  The user then "drops" the icon over 
  18292. the target object by releasing the mouse button.  For this reason, the 
  18293. technique is also known as "drag and drop" manipulation. 
  18294.  
  18295.  
  18296. ΓòÉΓòÉΓòÉ 33.52. DLL ΓòÉΓòÉΓòÉ
  18297.  
  18298. DLL 
  18299.  
  18300. See dynamic link library. 
  18301.  
  18302.  
  18303. ΓòÉΓòÉΓòÉ 33.53. domain ΓòÉΓòÉΓòÉ
  18304.  
  18305. domain 
  18306.  
  18307. Logical grouping of users, applications and devices in a network, which is 
  18308. treated as a coherent unit for network administration purposes. 
  18309.  
  18310.  
  18311. ΓòÉΓòÉΓòÉ 33.54. dormant ΓòÉΓòÉΓòÉ
  18312.  
  18313. dormant 
  18314.  
  18315. Term used to denote the state of a Workplace Shell object when no views of that 
  18316. object are currently open.  Dormant objects typically do not "own" system 
  18317. resources, and their instance data is in an unknown state. 
  18318.  
  18319.  
  18320. ΓòÉΓòÉΓòÉ 33.55. DOS ΓòÉΓòÉΓòÉ
  18321.  
  18322. DOS 
  18323.  
  18324. Disk Operating System; operating system for programmable workstations, 
  18325. originally developed by Microsoft Corporation as MS DOS, and marketed under 
  18326. license by IBM.  Later versions were developed jointly by Microsoft and IBM. 
  18327.  
  18328.  
  18329. ΓòÉΓòÉΓòÉ 33.56. DOS Compatibility Box ΓòÉΓòÉΓòÉ
  18330.  
  18331. DOS Compatibility Box 
  18332.  
  18333. Facility provided by OS/2 Version 1.3 that allows a single real mode (DOS) 
  18334. application to execute under control of OS/2, occupying the lowest 640 KB of 
  18335. physical memory.  A real mode application executing in this way may coexist 
  18336. with other protected mode applications in the same system. Certain restrictions 
  18337. are imposed on applications executing in the DOS Compatibility Box; an 
  18338. application may not be a TSR application, nor should it be a time-dependent 
  18339. application (such as a terminal emulator).  These limitations are overcome by 
  18340. the Multiple Virtual DOS Machines feature implemented by OS/2 Version 2.0. 
  18341.  
  18342.  
  18343. ΓòÉΓòÉΓòÉ 33.57. DOS settings ΓòÉΓòÉΓòÉ
  18344.  
  18345. DOS settings 
  18346.  
  18347. Feature implemented within the Multiple Virtual DOS Machines component of OS/2 
  18348. Version 2.0, enabling a virtual DOS machine to be customized to suit the 
  18349. requirements of an application running within it.  This feature enables greater 
  18350. application compatibility for virtual DOS machines. 
  18351.  
  18352.  
  18353. ΓòÉΓòÉΓòÉ 33.58. drag and drop ΓòÉΓòÉΓòÉ
  18354.  
  18355. drag and drop 
  18356.  
  18357. See direct manipulation. 
  18358.  
  18359.  
  18360. ΓòÉΓòÉΓòÉ 33.59. dragitem ΓòÉΓòÉΓòÉ
  18361.  
  18362. dragitem 
  18363.  
  18364. In the context of direct manipulation, an item that is currently being dragged 
  18365. on the desktop by the user. 
  18366.  
  18367.  
  18368. ΓòÉΓòÉΓòÉ 33.60. drawdown ΓòÉΓòÉΓòÉ
  18369.  
  18370. drawdown 
  18371.  
  18372. Process of copying an application resource from a master-level library to a 
  18373. developer's own working library. 
  18374.  
  18375.  
  18376. ΓòÉΓòÉΓòÉ 33.61. dynamic linking ΓòÉΓòÉΓòÉ
  18377.  
  18378. dynamic linking 
  18379.  
  18380. Process under OS/2, whereby resolution of external references within an 
  18381. application to modules in dynamic link libraries (DLLs) is deferred until load 
  18382. time or run time.  This allows modification of modules contained in DLLs 
  18383. without the need to link-edit an application once more.  Since DLLs are 
  18384. normally written as reentrant code, dynamic linking also allows multiple 
  18385. applications to use the same copy of a DLL in memory, thus reducing the storage 
  18386. requirements of OS/2 applications. 
  18387.  
  18388.  
  18389. ΓòÉΓòÉΓòÉ 33.62. dynamic link library ΓòÉΓòÉΓòÉ
  18390.  
  18391. dynamic link library 
  18392.  
  18393. Library containing OS/2 application code and/or resources, which may be linked 
  18394. by one or more applications using the OS/2 dynamic linking process. 
  18395.  
  18396.  
  18397. ΓòÉΓòÉΓòÉ 33.63. EHLLAPI ΓòÉΓòÉΓòÉ
  18398.  
  18399. EHLLAPI 
  18400.  
  18401. Emulator High-Level Language Application Programming Interface; programming 
  18402. interface provided by OS/2 Extended Edition Version 1.x and OS/2 Extended 
  18403. Services, which enables PWS applications to emulate keystroking for host 
  18404. terminal emulation sessions. 
  18405.  
  18406.  
  18407. ΓòÉΓòÉΓòÉ 33.64. encapsulation ΓòÉΓòÉΓòÉ
  18408.  
  18409. encapsulation 
  18410.  
  18411. Concept whereby the definition of a data object is included as part of the 
  18412. application object that owns and manipulates the data object. 
  18413.  
  18414.  
  18415. ΓòÉΓòÉΓòÉ 33.65. entity ΓòÉΓòÉΓòÉ
  18416.  
  18417. entity 
  18418.  
  18419. Data item that must be manipulated by an application.  See also logical data 
  18420. entity, data object and application object. 
  18421.  
  18422.  
  18423. ΓòÉΓòÉΓòÉ 33.66. event-driven ΓòÉΓòÉΓòÉ
  18424.  
  18425. event-driven 
  18426.  
  18427. Term used to describe an application environment where the sequence of 
  18428. processing is determined primarily by the application's response to external 
  18429. events, which may be initiated by the user, the operating system or other 
  18430. applications. 
  18431.  
  18432.  
  18433. ΓòÉΓòÉΓòÉ 33.67. event semaphore ΓòÉΓòÉΓòÉ
  18434.  
  18435. event semaphore 
  18436.  
  18437. Semaphore used by applications to signal an event such as the termination of a 
  18438. thread. 
  18439.  
  18440.  
  18441. ΓòÉΓòÉΓòÉ 33.68. exception handler ΓòÉΓòÉΓòÉ
  18442.  
  18443. exception handler 
  18444.  
  18445. Application-supplied routine that is registered with OS/2 Version 2.0 on a 
  18446. per-thread basis, and invoked by the operating system whenever an exception 
  18447. condition occurs for that thread.  Multiple exception handlers may be chained 
  18448. for each thread, and a handler may process an exception or allow it to pass on 
  18449. down the chain.  OS/2 Version 2.0 itself provides default exception handlers 
  18450. for all exception conditions. 
  18451.  
  18452.  
  18453. ΓòÉΓòÉΓòÉ 33.69. execution instance ΓòÉΓòÉΓòÉ
  18454.  
  18455. execution instance 
  18456.  
  18457. An individual process executing a reentrant code module.  Such a module may 
  18458. have multiple execution instances in existence at any one time; under OS/2, the 
  18459. operating system maintains a separate task state for each execution instance. 
  18460.  
  18461.  
  18462. ΓòÉΓòÉΓòÉ 33.70. exportable entry point ΓòÉΓòÉΓòÉ
  18463.  
  18464. exportable entry point 
  18465.  
  18466. Entry point for an application function that is invoked from outside the 
  18467. current executable module; for example, window procedures, which are invoked by 
  18468. Presentation Manager on the application's behalf, rather than by the 
  18469. application itself. 
  18470.  
  18471.  
  18472. ΓòÉΓòÉΓòÉ 33.71. external entity ΓòÉΓòÉΓòÉ
  18473.  
  18474. external entity 
  18475.  
  18476. An entity such as a remote system or data entry device which exists outside the 
  18477. application, and interacts with the application.  Such an entity and the 
  18478. methods to manipulate it may be encapsulated in an application object. 
  18479.  
  18480.  
  18481. ΓòÉΓòÉΓòÉ 33.72. external reference ΓòÉΓòÉΓòÉ
  18482.  
  18483. external reference 
  18484.  
  18485. Program call to a memory address outside the current executable module; the 
  18486. target of the call is typically a library routine. Examples of external 
  18487. references are OS/2 system service calls. 
  18488.  
  18489.  
  18490. ΓòÉΓòÉΓòÉ 33.73. EXPORTS statement ΓòÉΓòÉΓòÉ
  18491.  
  18492. EXPORTS statement 
  18493.  
  18494. Statement used in a module definition file to define exportable entry points. 
  18495. Required by all OS/2 Presentation Manager applications under OS/2 Version 1.3 
  18496. unless the -Alfu option is specified at compile time. 
  18497.  
  18498.  
  18499. ΓòÉΓòÉΓòÉ 33.74. far call ΓòÉΓòÉΓòÉ
  18500.  
  18501. far call 
  18502.  
  18503. When using the segmented memory model, a program call to a routine located in a 
  18504. different memory segment; such a call must use both a segment address and an 
  18505. offset in the branch instruction, rather than just the offset as is the case 
  18506. with a near call.  By default, C programs compiled with the medium or large 
  18507. memory models generate far calls. 
  18508.  
  18509.  
  18510. ΓòÉΓòÉΓòÉ 33.75. FIFO ΓòÉΓòÉΓòÉ
  18511.  
  18512. FIFO 
  18513.  
  18514. First In, First Out; term used to describe a queueing algorithm whereby items 
  18515. are serially inserted into and removed from a queue structure, and where the 
  18516. first item placed into a queue structure is the first item to be removed. 
  18517.  
  18518.  
  18519. ΓòÉΓòÉΓòÉ 33.76. flat memory model ΓòÉΓòÉΓòÉ
  18520.  
  18521. flat memory model 
  18522.  
  18523. Conceptual view of real memory implemented by OS/2 Version 2.0, where the 
  18524. operating system regards memory as a single linear address range of up to 4 GB. 
  18525.  
  18526.  
  18527. ΓòÉΓòÉΓòÉ 33.77. focus ΓòÉΓòÉΓòÉ
  18528.  
  18529. focus 
  18530.  
  18531. See input focus. 
  18532.  
  18533.  
  18534. ΓòÉΓòÉΓòÉ 33.78. Font Editor ΓòÉΓòÉΓòÉ
  18535.  
  18536. Font Editor 
  18537.  
  18538. Utility provided with the IBM Developer's Toolkit for OS/2 2.0. which enables 
  18539. the design and creation of new fonts. 
  18540.  
  18541.  
  18542. ΓòÉΓòÉΓòÉ 33.79. frame area ΓòÉΓòÉΓòÉ
  18543.  
  18544. frame area 
  18545.  
  18546. See frame window. 
  18547.  
  18548.  
  18549. ΓòÉΓòÉΓòÉ 33.80. frame window ΓòÉΓòÉΓòÉ
  18550.  
  18551. frame window 
  18552.  
  18553. A window that contains the border visible on the screen; various control 
  18554. windows such as the title bar, menu bar and icons are children of the frame 
  18555. window.  The client window, used by the application to display information, is 
  18556. also a child of the frame window. 
  18557.  
  18558.  
  18559. ΓòÉΓòÉΓòÉ 33.81. functional decomposition ΓòÉΓòÉΓòÉ
  18560.  
  18561. functional decomposition 
  18562.  
  18563. Application design technique also known as structured programming, whereby 
  18564. procedures become the focus of the application design and are progressively 
  18565. divided into smaller units of work until an atomic level is reached that may be 
  18566. implemented by a series of operations in a conventional programming language. 
  18567.  
  18568.  
  18569. ΓòÉΓòÉΓòÉ 33.82. GB ΓòÉΓòÉΓòÉ
  18570.  
  18571. GB 
  18572.  
  18573. Gigabyte; 1024 Megabytes, or 1024 x 1024 x 1024 bytes. 
  18574.  
  18575.  
  18576. ΓòÉΓòÉΓòÉ 33.83. graphical model ΓòÉΓòÉΓòÉ
  18577.  
  18578. graphical model 
  18579.  
  18580. Object-action, event-driven user interface model defined in the IBM Systems 
  18581. Application Architecture CUA Advanced Guide to User Interface Design.  The 
  18582. graphical model makes extensive use of windows and graphical visual cues, and 
  18583. is supported by Presentation Manager. 
  18584.  
  18585.  
  18586. ΓòÉΓòÉΓòÉ 33.84. GRE ΓòÉΓòÉΓòÉ
  18587.  
  18588. GRE 
  18589.  
  18590. Graphical Rendering Engine; component of the OS/2 Version 2.0 operating system 
  18591. responsible for drawing graphical items on the display. 
  18592.  
  18593.  
  18594. ΓòÉΓòÉΓòÉ 33.85. guard page ΓòÉΓòÉΓòÉ
  18595.  
  18596. guard page 
  18597.  
  18598. Uppermost committed page of a private memory object, or lowermost committed 
  18599. page of a shared memory object, set using the PAG_GUARD flag.  A write 
  18600. operation into a guard page generates a guard page exception, which may be 
  18601. trapped by an application-registered exception handler, which may then commit 
  18602. additional pages of storage.  See exception handler. 
  18603.  
  18604.  
  18605. ΓòÉΓòÉΓòÉ 33.86. guard page exception ΓòÉΓòÉΓòÉ
  18606.  
  18607. guard page exception 
  18608.  
  18609. Exception condition generated by OS/2 Version 2.0 when an application writes 
  18610. into a guard page.  Like other exception conditions, the guard page exception 
  18611. may be trapped by an exception handler registered by the application.  See 
  18612. exception handler. 
  18613.  
  18614.  
  18615. ΓòÉΓòÉΓòÉ 33.87. help instance ΓòÉΓòÉΓòÉ
  18616.  
  18617. help instance 
  18618.  
  18619. A link between an application and the Information Presentation Facility, which 
  18620. allows information to be passed between the two, in order to display help 
  18621. panels and enable the application to be informed of events occurring within 
  18622. help windows. 
  18623.  
  18624.  
  18625. ΓòÉΓòÉΓòÉ 33.88. help library ΓòÉΓòÉΓòÉ
  18626.  
  18627. help library 
  18628.  
  18629. A file produced by the IPF compiler, which contains a collection of help panels 
  18630. related to a particular application, and which is used by the Information 
  18631. Presentation Facility to display help information for that application. 
  18632.  
  18633.  
  18634. ΓòÉΓòÉΓòÉ 33.89. help panel ΓòÉΓòÉΓòÉ
  18635.  
  18636. help panel 
  18637.  
  18638. A unit of help information, displayed in a help window under the control of the 
  18639. Information Presentation Facility. 
  18640.  
  18641.  
  18642. ΓòÉΓòÉΓòÉ 33.90. help window ΓòÉΓòÉΓòÉ
  18643.  
  18644. help window 
  18645.  
  18646. A window displayed by the Information Presentation Facility at the request of 
  18647. an application, containing a help panel with information pertaining to the 
  18648. active application window. 
  18649.  
  18650.  
  18651. ΓòÉΓòÉΓòÉ 33.91. Hungarian notation ΓòÉΓòÉΓòÉ
  18652.  
  18653. Hungarian notation 
  18654.  
  18655. Technique for including data typing in variable and procedure names within 
  18656. application source code; devised by Charles Simonyi of Microsoft. 
  18657.  
  18658.  
  18659. ΓòÉΓòÉΓòÉ 33.92. hypergraphics ΓòÉΓòÉΓòÉ
  18660.  
  18661. hypergraphics 
  18662.  
  18663. Under the Information Presentation Facility, a portion of a bitmap displayed in 
  18664. a help panel or online document, which may be selected by the end user. 
  18665. Selecting such an item causes an event to occur, such as the display of another 
  18666. help panel, a popup window, the dispatch of a message to the parent application 
  18667. or the start of a new application.  See also hypertext. 
  18668.  
  18669.  
  18670. ΓòÉΓòÉΓòÉ 33.93. hypertext ΓòÉΓòÉΓòÉ
  18671.  
  18672. hypertext 
  18673.  
  18674. Under the Information Presentation Facility, a word or phrase in a help panel 
  18675. or online document, which may be selected by the end user.  Selecting such an 
  18676. item causes an event to occur, such as the display of another help panel, a 
  18677. popup window, the dispatch of a message to the parent application or the start 
  18678. of a new application.  See also hypergraphics. 
  18679.  
  18680.  
  18681. ΓòÉΓòÉΓòÉ 33.94. icon ΓòÉΓòÉΓòÉ
  18682.  
  18683. icon 
  18684.  
  18685. In the Presentation Manager user interface, a small graphical image that 
  18686. represents an application, window or other object such as a file or device. 
  18687. The user may directly manipulate icons on the desktop to perform work tasks. 
  18688.  
  18689.  
  18690. ΓòÉΓòÉΓòÉ 33.95. Icon Editor ΓòÉΓòÉΓòÉ
  18691.  
  18692. Icon Editor 
  18693.  
  18694. Utility application provided with OS/2 Version 2.0, which may be used to design 
  18695. and create icons. 
  18696.  
  18697.  
  18698. ΓòÉΓòÉΓòÉ 33.96. import library ΓòÉΓòÉΓòÉ
  18699.  
  18700. import library 
  18701.  
  18702. Library file containing information on functions and resources contained in a 
  18703. dynamic link library.  Used as input to the OS/2 linkage editor.  Use of an 
  18704. import library negates the need for an IMPORTS statement in an application's 
  18705. module definition file. 
  18706.  
  18707.  
  18708. ΓòÉΓòÉΓòÉ 33.97. IMPORTS statement ΓòÉΓòÉΓòÉ
  18709.  
  18710. IMPORTS statement 
  18711.  
  18712. Statement used in a module definition file to denote functions that will be 
  18713. imported from a dynamic link library.  Required for any application that uses a 
  18714. DLL, unless an import library containing information on the DLL functions is 
  18715. specified at link-edit time. 
  18716.  
  18717.  
  18718. ΓòÉΓòÉΓòÉ 33.98. Information Presentation Facility ΓòÉΓòÉΓòÉ
  18719.  
  18720. Information Presentation Facility 
  18721.  
  18722. Facility provided by OS/2 Version 1.2 and above (including OS/2 Version 2.0), 
  18723. by which application developers may produce online documentation and 
  18724. context-sensitive online help panels for their applications, using an IPF tag 
  18725. language and an IPF compiler. 
  18726.  
  18727.  
  18728. ΓòÉΓòÉΓòÉ 33.99. inheritance ΓòÉΓòÉΓòÉ
  18729.  
  18730. inheritance 
  18731.  
  18732. Concept whereby an application object takes on the properties of the object 
  18733. class to which it belongs;  such properties may include the definition of 
  18734. instance variables and data objects.  Object classes may also be defined in 
  18735. terms of other, previously defined object classes; the new object class then 
  18736. takes on the properties and methods of its parent class or classes (which 
  18737. themselves may be defined in terms of other classes). 
  18738.  
  18739.  
  18740. ΓòÉΓòÉΓòÉ 33.100. inheritance hierarchy ΓòÉΓòÉΓòÉ
  18741.  
  18742. inheritance hierarchy 
  18743.  
  18744. Term used to describe the chain of interdependence formed when object classes 
  18745. are defined in terms of other currently existing classes, and where the 
  18746. definition of an object class is thus dependent upon the presence of its parent 
  18747. class or classes. 
  18748.  
  18749.  
  18750. ΓòÉΓòÉΓòÉ 33.101. input focus ΓòÉΓòÉΓòÉ
  18751.  
  18752. input focus 
  18753.  
  18754. In the Presentation Manager environment, the user interacts with a single 
  18755. window at any given moment;  that window is said to have the input focus. 
  18756.  
  18757.  
  18758. ΓòÉΓòÉΓòÉ 33.102. instance ΓòÉΓòÉΓòÉ
  18759.  
  18760. instance 
  18761.  
  18762. An individual application object (or Workplace Shell object) that belongs to a 
  18763. particular object class.  See also execution instance. 
  18764.  
  18765.  
  18766. ΓòÉΓòÉΓòÉ 33.103. instance data ΓòÉΓòÉΓòÉ
  18767.  
  18768. instance data 
  18769.  
  18770. A data item that is created and owned by a single instance of an application 
  18771. object class.  An instance variable is typically defined by the class, and the 
  18772. definition is thus common to all instances of that class, but a separate data 
  18773. item is maintained for each instance. 
  18774.  
  18775.  
  18776. ΓòÉΓòÉΓòÉ 33.104. Interface Control Document ΓòÉΓòÉΓòÉ
  18777.  
  18778. Interface Control Document 
  18779.  
  18780. Document that contains descriptions of all generic library objects and 
  18781. functions, along with their external interfaces including both input and output 
  18782. data.  The interface control document is used by application developers who 
  18783. wish to utilize library objects and functions in their applications. 
  18784.  
  18785.  
  18786. ΓòÉΓòÉΓòÉ 33.105. IPF ΓòÉΓòÉΓòÉ
  18787.  
  18788. IPF 
  18789.  
  18790. See Information Presentation Facility. 
  18791.  
  18792.  
  18793. ΓòÉΓòÉΓòÉ 33.106. IPF compiler ΓòÉΓòÉΓòÉ
  18794.  
  18795. IPF compiler 
  18796.  
  18797. Compiler provided with the IBM Developer's Toolkit for OS/2 2.0, which allows 
  18798. the compilation of source files into help libraries or online documents that 
  18799. may be displayed using the Information Presentation Facility. 
  18800.  
  18801.  
  18802. ΓòÉΓòÉΓòÉ 33.107. IPF-controlled viewport ΓòÉΓòÉΓòÉ
  18803.  
  18804. IPF-controlled viewport 
  18805.  
  18806. Viewport within a help window or online document window, where the formatting 
  18807. and display of information within that window is controlled by the Information 
  18808. Presentation Facility.  This is the default case for information displayed 
  18809. using the Information Presentation Facility.  See also application-controlled 
  18810. viewport. 
  18811.  
  18812.  
  18813. ΓòÉΓòÉΓòÉ 33.108. IPF tag language ΓòÉΓòÉΓòÉ
  18814.  
  18815. IPF tag language 
  18816.  
  18817. Text formatting language used by the Information Presentation Facility, whereby 
  18818. tags are inserted into the ASCII source text to cause formatting to occur.  The 
  18819. tags and syntax of the IPF tag language are similar to IBM's Generalized Markup 
  18820. Language (GML). 
  18821.  
  18822.  
  18823. ΓòÉΓòÉΓòÉ 33.109. KB ΓòÉΓòÉΓòÉ
  18824.  
  18825. KB 
  18826.  
  18827. Kilobyte; 1024 bytes. 
  18828.  
  18829.  
  18830. ΓòÉΓòÉΓòÉ 33.110. LAN ΓòÉΓòÉΓòÉ
  18831.  
  18832. LAN 
  18833.  
  18834. See local area network. 
  18835.  
  18836.  
  18837. ΓòÉΓòÉΓòÉ 33.111. LIFO ΓòÉΓòÉΓòÉ
  18838.  
  18839. LIFO 
  18840.  
  18841. Last In, First Out; term used to describe a queueing algorithm whereby items 
  18842. are serially inserted into and removed from the queue structure, and where the 
  18843. most recently inserted item is the first item to be removed. 
  18844.  
  18845.  
  18846. ΓòÉΓòÉΓòÉ 33.112. load-time dynamic linking ΓòÉΓòÉΓòÉ
  18847.  
  18848. load-time dynamic linking 
  18849.  
  18850. Form of dynamic linking where resolution of external references takes place 
  18851. during loading of the application into memory.  Load-time dynamic linking is 
  18852. typically used to share a single memory-resident copy of common application 
  18853. service routines, or to isolate portions of application code from the remainder 
  18854. of the application, thereby facilitating any future change management.  See 
  18855. also run-time dynamic linking. 
  18856.  
  18857.  
  18858. ΓòÉΓòÉΓòÉ 33.113. local area network ΓòÉΓòÉΓòÉ
  18859.  
  18860. local area network 
  18861.  
  18862. A network, typically composed of programmable workstations, in which the 
  18863. constituent nodes are situated in direct geographical proximity to one another, 
  18864. usually within the same property boundary.  A number of local area networks may 
  18865. be "bridged" together to form a wide area network that may extend across 
  18866. multiple geographical locations. 
  18867.  
  18868.  
  18869. ΓòÉΓòÉΓòÉ 33.114. logical data entity ΓòÉΓòÉΓòÉ
  18870.  
  18871. logical data entity 
  18872.  
  18873. Term used to describe a coherent unit of logical data, such as a block of text. 
  18874. This data may simultaneously exist in numerous representations within the 
  18875. system, either in memory or on secondary storage devices.  See also data object 
  18876. and application object. 
  18877.  
  18878.  
  18879. ΓòÉΓòÉΓòÉ 33.115. MB ΓòÉΓòÉΓòÉ
  18880.  
  18881. MB 
  18882.  
  18883. Megabyte; 1024 kilobytes, or 1024 x 1024 bytes. 
  18884.  
  18885.  
  18886. ΓòÉΓòÉΓòÉ 33.116. memory object ΓòÉΓòÉΓòÉ
  18887.  
  18888. memory object 
  18889.  
  18890. Logical unit of memory requested by an application, which forms the granular 
  18891. unit of memory manipulation from the application viewpoint. A memory object may 
  18892. be up to 512 MB in size under OS/2 Version 2.0. 
  18893.  
  18894.  
  18895. ΓòÉΓòÉΓòÉ 33.117. menu bar ΓòÉΓòÉΓòÉ
  18896.  
  18897. menu bar 
  18898.  
  18899. Area near the top of a CUA-conforming window, which contains a horizontally 
  18900. oriented list of actions that relate to the data object being manipulated in 
  18901. the window. 
  18902.  
  18903.  
  18904. ΓòÉΓòÉΓòÉ 33.118. message ΓòÉΓòÉΓòÉ
  18905.  
  18906. message 
  18907.  
  18908. Data structure used by OS/2 Presentation Manager for communication between 
  18909. window procedures, or between Presentation Manager and a window procedure. 
  18910. Messages may be system-defined or user-defined.  See also message class. 
  18911.  
  18912.  
  18913. ΓòÉΓòÉΓòÉ 33.119. message box ΓòÉΓòÉΓòÉ
  18914.  
  18915. message box 
  18916.  
  18917. Within Presentation Manager, a specialized type of dialog box that carries out 
  18918. a simple structured dialog with the user.  This dialog is limited to the 
  18919. display of some textual information, and the input of a single choice from a 
  18920. limited, finite set of mutually exclusive options.  A message box is simpler to 
  18921. process than a dialog box, and is useful in circumstances where the 
  18922. sophistication of a dialog box is unnecessary. 
  18923.  
  18924.  
  18925. ΓòÉΓòÉΓòÉ 33.120. message class ΓòÉΓòÉΓòÉ
  18926.  
  18927. message class 
  18928.  
  18929. Logical grouping of messages with common properties.  Under Presentation 
  18930. Manager, messages are grouped into classes with the name of the message class 
  18931. and the definitions of message parameters being common to all instances of that 
  18932. class.  Individual instances differ in their destination window and in the 
  18933. contents of their message parameters. 
  18934.  
  18935.  
  18936. ΓòÉΓòÉΓòÉ 33.121. metaclass ΓòÉΓòÉΓòÉ
  18937.  
  18938. metaclass 
  18939.  
  18940. Term used to describe the conjunction of an object and its class information; 
  18941. that is, the information pertaining to the class as a whole, rather than to a 
  18942. single instance of the class.  Each class is itself an object, which is an 
  18943. instance of the metaclass. 
  18944.  
  18945.  
  18946. ΓòÉΓòÉΓòÉ 33.122. method ΓòÉΓòÉΓòÉ
  18947.  
  18948. method 
  18949.  
  18950. In object-oriented terms, a routine or procedure used to manipulate a data 
  18951. object.  A group of methods, together with a definition of the data object 
  18952. itself, constitute an application object. 
  18953.  
  18954.  
  18955. ΓòÉΓòÉΓòÉ 33.123. mixed model programming ΓòÉΓòÉΓòÉ
  18956.  
  18957. mixed model programming 
  18958.  
  18959. Technique of combining 16-bit and 32-bit modules and resources within the same 
  18960. application under OS/2 Version 2.0.  Mixed model programming requires some 
  18961. special considerations when passing control and parameters between 16-bit and 
  18962. 32-bit modules and resources. 
  18963.  
  18964.  
  18965. ΓòÉΓòÉΓòÉ 33.124. modal ΓòÉΓòÉΓòÉ
  18966.  
  18967. modal 
  18968.  
  18969. Term used to describe a message box or dialog box for which processing must be 
  18970. completed before user interaction may continue.  Two types of modal dialog are 
  18971. possible:  application-modal and system-modal.  See also modeless. 
  18972.  
  18973.  
  18974. ΓòÉΓòÉΓòÉ 33.125. modeless ΓòÉΓòÉΓòÉ
  18975.  
  18976. modeless 
  18977.  
  18978. Term used to describe a dialog box which is displayed on the screen, but which 
  18979. does not require immediate interaction with the user, who may continue to 
  18980. interact with other windows while the dialog box is displayed. 
  18981.  
  18982.  
  18983. ΓòÉΓòÉΓòÉ 33.126. module-based ΓòÉΓòÉΓòÉ
  18984.  
  18985. module-based 
  18986.  
  18987. Term used to describe an implementation of object-oriented programming, whereby 
  18988. an object class is completely defined in its own right, and does not depend 
  18989. upon the definitions of other classes. Such an approach provides increased 
  18990. levels of granularity and thus enhances object reusability, albeit at the 
  18991. expense of additional complexity during creation of the object.  Compare with 
  18992. class-based approach. 
  18993.  
  18994.  
  18995. ΓòÉΓòÉΓòÉ 33.127. module definition file ΓòÉΓòÉΓòÉ
  18996.  
  18997. module definition file 
  18998.  
  18999. ASCII text file typically used with OS/2 Presentation Manager applications to 
  19000. define information such as module names, stack and heap sizes and exportable 
  19001. entry points.  Used as input to the OS/2 link-editor. 
  19002.  
  19003.  
  19004. ΓòÉΓòÉΓòÉ 33.128. Multiple Virtual DOS Machines ΓòÉΓòÉΓòÉ
  19005.  
  19006. Multiple Virtual DOS Machines 
  19007.  
  19008. Feature of OS/2 Version 2.0 that enables multiple DOS applications to execute 
  19009. concurrently in full-screen or windowed mode under OS/2 Version 2.0, in 
  19010. conjunction with other 16-bit or 32-bit applications, with full pre-emptive 
  19011. multitasking and memory protection between tasks. 
  19012.  
  19013.  
  19014. ΓòÉΓòÉΓòÉ 33.129. multiprogramming ΓòÉΓòÉΓòÉ
  19015.  
  19016. multiprogramming 
  19017.  
  19018. Term used to describe an operating system environment that allows the 
  19019. concurrent execution of multiple applications in the same system. 
  19020.  
  19021.  
  19022. ΓòÉΓòÉΓòÉ 33.130. multitasking ΓòÉΓòÉΓòÉ
  19023.  
  19024. multitasking 
  19025.  
  19026. Extension of the multiprogramming concept, whereby processor time is 
  19027. distributed among multiple applications by giving each application access to 
  19028. the processor for short periods of time.  Multitasking may be cooperative or 
  19029. pre-emptive in nature. 
  19030.  
  19031.  
  19032. ΓòÉΓòÉΓòÉ 33.131. multithreading ΓòÉΓòÉΓòÉ
  19033.  
  19034. multithreading 
  19035.  
  19036. Extension of the multitasking concept, whereby multiple "tasks" may exist 
  19037. within a single application, allowing different portions of the application to 
  19038. execute asynchronously to one another.  Multithreading allows an application to 
  19039. continue to respond to user input while lengthy processing takes place in the 
  19040. background. 
  19041.  
  19042.  
  19043. ΓòÉΓòÉΓòÉ 33.132. Mutex semaphore ΓòÉΓòÉΓòÉ
  19044.  
  19045. Mutex semaphore 
  19046.  
  19047. Semaphore used to control access to a resource that may be safely accessed only 
  19048. by a single application thread at any time. 
  19049.  
  19050.  
  19051. ΓòÉΓòÉΓòÉ 33.133. MuxWait semaphore ΓòÉΓòÉΓòÉ
  19052.  
  19053. MuxWait semaphore 
  19054.  
  19055. Semaphore used when waiting for multiple events to occur or for multiple 
  19056. resources to be freed. 
  19057.  
  19058.  
  19059. ΓòÉΓòÉΓòÉ 33.134. near call ΓòÉΓòÉΓòÉ
  19060.  
  19061. near call 
  19062.  
  19063. Under the segmented memory model, a program call to a routine located within 
  19064. the same memory segment. Such a call provides only the offset of the routine 
  19065. within the segment; a segment address is not needed since all application code 
  19066. is assumed to reside in the same memory segment.  By default, C programs 
  19067. compiled using the small or compact memory models generate near calls.  See 
  19068. also far call. 
  19069.  
  19070.  
  19071. ΓòÉΓòÉΓòÉ 33.135. NPX ΓòÉΓòÉΓòÉ
  19072.  
  19073. NPX 
  19074.  
  19075. Numeric Processor Extension; term used in reference to the exception condition 
  19076. generated by the 80386 processor when an application issues a numeric 
  19077. coprocessor instruction in a machine with no coprocessor installed.  Note that 
  19078. OS/2 Version 2.0 will trap the NPX exception and emulate the numeric 
  19079. coprocessor function within the operating system, returning the result to the 
  19080. application exactly as if a physical coprocessor were installed. 
  19081.  
  19082.  
  19083. ΓòÉΓòÉΓòÉ 33.136. object ΓòÉΓòÉΓòÉ
  19084.  
  19085. object 
  19086.  
  19087. A collection of data and methods (procedures) that operate on that data, which 
  19088. together represent a logical entity in the system.  In object-oriented 
  19089. programming, objects are grouped into classes that share common data 
  19090. definitions and methods.  Each object in the class is said to be an instance of 
  19091. the class.  See also instance, object class, data object, application object. 
  19092.  
  19093.  
  19094. ΓòÉΓòÉΓòÉ 33.137. object class ΓòÉΓòÉΓòÉ
  19095.  
  19096. object class 
  19097.  
  19098. Logical grouping of application objects with similar properties; methods are 
  19099. normally associated with an object class, rather than with individual instances 
  19100. of that class.  Under the Workplace Shell, an object class is defined using a 
  19101. class definition file. 
  19102.  
  19103.  
  19104. ΓòÉΓòÉΓòÉ 33.138. object window ΓòÉΓòÉΓòÉ
  19105.  
  19106. object window 
  19107.  
  19108. A conceptual window that does not appear on the screen, and is associated with 
  19109. a data object such as a file or database.  In effect, an object window is 
  19110. merely an address to which messages may be sent to cause manipulation of a 
  19111. particular data object. 
  19112.  
  19113.  
  19114. ΓòÉΓòÉΓòÉ 33.139. online document ΓòÉΓòÉΓòÉ
  19115.  
  19116. online document 
  19117.  
  19118. A set of information relating to an application or a business process, which is 
  19119. developed using the IPF tag language, compiled and viewed using the Information 
  19120. Presentation Facility.  An online document, unlike a help library, is not 
  19121. necessarily related to a single application, and exists in a "standalone" 
  19122. environment. 
  19123.  
  19124.  
  19125. ΓòÉΓòÉΓòÉ 33.140. online document window ΓòÉΓòÉΓòÉ
  19126.  
  19127. online document window 
  19128.  
  19129. A window displayed by the Information Presentation Facility, using the VIEW.EXE 
  19130. utility, and which contains information from an online document. 
  19131.  
  19132.  
  19133. ΓòÉΓòÉΓòÉ 33.141. Operating System/2 ΓòÉΓòÉΓòÉ
  19134.  
  19135. Operating System/2 
  19136.  
  19137. Operating system for programmable workstations, offering more sophisticated 
  19138. multiprogramming and multitasking capabilities and larger memory support than 
  19139. DOS. 
  19140.  
  19141.  
  19142. ΓòÉΓòÉΓòÉ 33.142. optimized window ΓòÉΓòÉΓòÉ
  19143.  
  19144. optimized window 
  19145.  
  19146. Term used to describe a dialog box; such a window is created for a specific 
  19147. purpose, containing a number of control windows, and is deemed to have been 
  19148. created at the optimum size to display those control windows.  Thus an 
  19149. optimized window may not be resized by the user, nor may it be minimized or 
  19150. maximized. 
  19151.  
  19152.  
  19153. ΓòÉΓòÉΓòÉ 33.143. optlink ΓòÉΓòÉΓòÉ
  19154.  
  19155. optlink 
  19156.  
  19157. Default linkage convention using in C programming under the IBM C Set/2 
  19158. compiler, which causes the compiler to generate object code for a function or 
  19159. subroutine, such that parameters are placed on the stack in right-to-left 
  19160. order, and the stack is cleared by the calling function when control is 
  19161. returned.  The optlink linkage convention differs from the system linkage 
  19162. convention in the preservation of register values and the handling of return 
  19163. values. 
  19164.  
  19165.  
  19166. ΓòÉΓòÉΓòÉ 33.144. OS/2 ΓòÉΓòÉΓòÉ
  19167.  
  19168. OS/2 
  19169.  
  19170. See Operating System/2. 
  19171.  
  19172.  
  19173. ΓòÉΓòÉΓòÉ 33.145. page ΓòÉΓòÉΓòÉ
  19174.  
  19175. page 
  19176.  
  19177. Granular unit for memory management using the 80386 or 80486 processors with 
  19178. the paging feature enabled.  A page is a 4 KB contiguous unit of memory, which 
  19179. the processor manipulates as a single entity for the purpose of memory 
  19180. manipulation and swapping. 
  19181.  
  19182.  
  19183. ΓòÉΓòÉΓòÉ 33.146. parent ΓòÉΓòÉΓòÉ
  19184.  
  19185. parent 
  19186.  
  19187. Immediate ancestor of a Workplace Shell object class; the object class from 
  19188. which the current object class was created by subclassing.  See also ancestor, 
  19189. descendant. 
  19190.  
  19191.  
  19192. ΓòÉΓòÉΓòÉ 33.147. pascal ΓòÉΓòÉΓòÉ
  19193.  
  19194. pascal 
  19195.  
  19196. Linkage convention used in C programming that causes the compiler to generate 
  19197. object code for a function or subroutine, such that parameters are placed on 
  19198. the stack in left-to-right order when the subroutine is called, and the stack 
  19199. is cleared by the called subroutine when control is returned.  Originally 
  19200. introduced by Microsoft with early versions of Microsoft Windows, when this 
  19201. convention saved several hundred bytes of system memory, and adopted by 
  19202. Presentation Manager under OS/2 Version 1.3.  Contrast with cdecl linkage 
  19203. convention. 
  19204.  
  19205.  
  19206. ΓòÉΓòÉΓòÉ 33.148. PC DOS ΓòÉΓòÉΓòÉ
  19207.  
  19208. PC DOS 
  19209.  
  19210. Personal Computer Disk Operating System; see DOS. 
  19211.  
  19212.  
  19213. ΓòÉΓòÉΓòÉ 33.149. persistent ΓòÉΓòÉΓòÉ
  19214.  
  19215. persistent 
  19216.  
  19217. Term used to describe Workplace Shell objects that are registered with the 
  19218. operating system and that continue to exist in the Workplace Shell after the 
  19219. system is re-IPLed. 
  19220.  
  19221.  
  19222. ΓòÉΓòÉΓòÉ 33.150. pipe ΓòÉΓòÉΓòÉ
  19223.  
  19224. pipe 
  19225.  
  19226. Facility provided by OS/2 for communication between threads and/or processes. 
  19227. Pipes may be named or unnamed. 
  19228.  
  19229.  
  19230. ΓòÉΓòÉΓòÉ 33.151. polymorphism ΓòÉΓòÉΓòÉ
  19231.  
  19232. polymorphism 
  19233.  
  19234. Concept whereby the behavior of an application object is dependent solely upon 
  19235. the class and contents of the messages received by that object, and is not 
  19236. affected by any other external factor.  Similarly, the effect of the same 
  19237. message class is dependent upon the application object to which it is passed, 
  19238. and that object's interpretation of the message. 
  19239.  
  19240.  
  19241. ΓòÉΓòÉΓòÉ 33.152. pre-emptive multitasking ΓòÉΓòÉΓòÉ
  19242.  
  19243. pre-emptive multitasking 
  19244.  
  19245. Multitasking implementation whereby the operating system provides a scheduler 
  19246. that periodically interrupts an executing task, saves its current state 
  19247. information and dispatches another task, thereby sharing system resources 
  19248. across multiple applications. 
  19249.  
  19250.  
  19251. ΓòÉΓòÉΓòÉ 33.153. Presentation Interface ΓòÉΓòÉΓòÉ
  19252.  
  19253. Presentation Interface 
  19254.  
  19255. Component of Systems Application Architecture Common Programming Interface, 
  19256. which defines an application programming interface for presentation services. 
  19257.  
  19258.  
  19259. ΓòÉΓòÉΓòÉ 33.154. Presentation Manager ΓòÉΓòÉΓòÉ
  19260.  
  19261. Presentation Manager 
  19262.  
  19263. Windowed, graphics-oriented user interface provided by OS/2 Version 1.1 and 
  19264. above; allows object-oriented applications to be written in conformance with 
  19265. Common User Access guidelines.  The Presentation Manager programming interface 
  19266. conforms to the Systems Application Architecture Common Programming Interface 
  19267. Presentation Interface specifications. 
  19268.  
  19269.  
  19270. ΓòÉΓòÉΓòÉ 33.155. presentation space ΓòÉΓòÉΓòÉ
  19271.  
  19272. presentation space 
  19273.  
  19274. In the context of Presentation Manager, a conceptual display surface onto which 
  19275. information is written.  A presentation space is a data object normally 
  19276. associated with a window. 
  19277.  
  19278.  
  19279. ΓòÉΓòÉΓòÉ 33.156. primary thread ΓòÉΓòÉΓòÉ
  19280.  
  19281. primary thread 
  19282.  
  19283. The first thread of execution created by an OS/2 application upon application 
  19284. startup.  In a Presentation Manager application, the primary thread typically 
  19285. provides processing for user interaction and short-lived application functions. 
  19286. Lengthy processing is typically carried out by a secondary thread, to preserve 
  19287. user responsiveness goals as defined in Common User Access guidelines. 
  19288.  
  19289.  
  19290. ΓòÉΓòÉΓòÉ 33.157. private semaphore ΓòÉΓòÉΓòÉ
  19291.  
  19292. private semaphore 
  19293.  
  19294. See semaphore. 
  19295.  
  19296.  
  19297. ΓòÉΓòÉΓòÉ 33.158. procedural entity ΓòÉΓòÉΓòÉ
  19298.  
  19299. procedural entity 
  19300.  
  19301. An entity, such as an administrative procedure, that interacts with other 
  19302. logical entities within an object-oriented application, and that itself may be 
  19303. encapsulated within an application object. 
  19304.  
  19305.  
  19306. ΓòÉΓòÉΓòÉ 33.159. process ΓòÉΓòÉΓòÉ
  19307.  
  19308. process 
  19309.  
  19310. In the context of OS/2, an instance of a particular program, which owns system 
  19311. resources such as threads, file handles and a memory map described by the 
  19312. process' local descriptor table.  A process may consist of one or more threads. 
  19313.  
  19314.  
  19315. ΓòÉΓòÉΓòÉ 33.160. process address space ΓòÉΓòÉΓòÉ
  19316.  
  19317. process address space 
  19318.  
  19319. Region of memory addressable by a single process under OS/2 Version 2.0.  Each 
  19320. process address space may be up to 512 MB in size. 
  19321.  
  19322.  
  19323. ΓòÉΓòÉΓòÉ 33.161. production-level ΓòÉΓòÉΓòÉ
  19324.  
  19325. production-level 
  19326.  
  19327. Term used to describe an application resource that has been unit-tested and 
  19328. baselined, and is placed in a production library from which multiple 
  19329. application developers may access it. 
  19330.  
  19331.  
  19332. ΓòÉΓòÉΓòÉ 33.162. programmable workstation ΓòÉΓòÉΓòÉ
  19333.  
  19334. programmable workstation 
  19335.  
  19336. An intelligent workstation device, containing its own processor, memory and 
  19337. possibly its own storage devices;  for example, the IBM Personal System/2 
  19338. family. 
  19339.  
  19340.  
  19341. ΓòÉΓòÉΓòÉ 33.163. promotion ΓòÉΓòÉΓòÉ
  19342.  
  19343. promotion 
  19344.  
  19345. Process of migrating a user-level application resource to production level 
  19346. after baselining. 
  19347.  
  19348.  
  19349. ΓòÉΓòÉΓòÉ 33.164. protect mode ΓòÉΓòÉΓòÉ
  19350.  
  19351. protect mode 
  19352.  
  19353. Native mode of execution for the Intel 80286 processor, whereby memory 
  19354. addresses are made by segment and offset, and a separate set of descriptors is 
  19355. maintained for memory addressable by each application, thereby providing memory 
  19356. isolation in a multiprogramming environment. 
  19357.  
  19358.  
  19359. ΓòÉΓòÉΓòÉ 33.165. PTDA ΓòÉΓòÉΓòÉ
  19360.  
  19361. PTDA 
  19362.  
  19363. Per Task Data Area; storage area maintained by OS/2 for each process executing 
  19364. in the system, containing process-specific execution data. 
  19365.  
  19366.  
  19367. ΓòÉΓòÉΓòÉ 33.166. pulldown menu ΓòÉΓòÉΓòÉ
  19368.  
  19369. pulldown menu 
  19370.  
  19371. A menu that appears when the user selects an item in a window's menu bar.  The 
  19372. pulldown menu acts as a "submenu", and contains a list of entries from which 
  19373. the user may select the required action.  Pulldown menus may be nested. 
  19374.  
  19375.  
  19376. ΓòÉΓòÉΓòÉ 33.167. PWS ΓòÉΓòÉΓòÉ
  19377.  
  19378. PWS 
  19379.  
  19380. See programmable workstation. 
  19381.  
  19382.  
  19383. ΓòÉΓòÉΓòÉ 33.168. queue ΓòÉΓòÉΓòÉ
  19384.  
  19385. queue 
  19386.  
  19387. Facility provided by OS/2 for communication between threads and/or processes. 
  19388.  
  19389.  
  19390. ΓòÉΓòÉΓòÉ 33.169. real mode ΓòÉΓòÉΓòÉ
  19391.  
  19392. real mode 
  19393.  
  19394. Mode of execution for the Intel 80286 processor, whereby the processor emulates 
  19395. the operation of an 8086/8088 processor.  In this mode, memory addresses are 
  19396. made to physical locations in memory, and addressability is limited to 1 MB. 
  19397. Real mode is the mode used by the DOS operating system; the design of this 
  19398. operating system further restricts applications' memory addressability to 640 
  19399. KB. 
  19400.  
  19401.  
  19402. ΓòÉΓòÉΓòÉ 33.170. rendering mechanism ΓòÉΓòÉΓòÉ
  19403.  
  19404. rendering mechanism 
  19405.  
  19406. Protocol that defines the communication between two windows or objects during a 
  19407. drag/drop operation.  Presentation Manager provides three standard rendering 
  19408. mechanisms for commonly used data types, and application developers may define 
  19409. their own rendering mechanisms to meet specific requirements. 
  19410.  
  19411.  
  19412. ΓòÉΓòÉΓòÉ 33.171. resource ΓòÉΓòÉΓòÉ
  19413.  
  19414. resource 
  19415.  
  19416. Item such as a window or dialog template, string table, menu table, etc., which 
  19417. may be defined externally and used by one or more Presentation Manager or 
  19418. Workplace Shell applications. 
  19419.  
  19420.  
  19421. ΓòÉΓòÉΓòÉ 33.172. resource compiler ΓòÉΓòÉΓòÉ
  19422.  
  19423. resource compiler 
  19424.  
  19425. Utility provided with IBM Developer's Toolkit for OS/2 2.0, which takes a 
  19426. resource script file and produces a precompiled resource or group resources 
  19427. that may be incorporated into an executable code module. 
  19428.  
  19429.  
  19430. ΓòÉΓòÉΓòÉ 33.173. resource script file ΓòÉΓòÉΓòÉ
  19431.  
  19432. resource script file 
  19433.  
  19434. ASCII text file with .RC extension, used to define resources for a Presentation 
  19435. Manager application.  Used as input to resource compiler. 
  19436.  
  19437.  
  19438. ΓòÉΓòÉΓòÉ 33.174. REXX ΓòÉΓòÉΓòÉ
  19439.  
  19440. REXX 
  19441.  
  19442. Restructured Extended Executor; procedural language included as part of OS/2 
  19443. Version 2.0, which provides batch language functions along with structured 
  19444. programming constructs such as loops, conditional testing and subroutines. 
  19445. Programs or subroutines written using the REXX language may be invoked directly 
  19446. from the command line, or from an application written in REXX or another 
  19447. programming language. 
  19448.  
  19449.  
  19450. ΓòÉΓòÉΓòÉ 33.175. run-time dynamic linking ΓòÉΓòÉΓòÉ
  19451.  
  19452. run-time dynamic linking 
  19453.  
  19454. Form of dynamic linking whereby modules and resources are loaded into memory 
  19455. during application execution, by the application issuing a WinLoadModule() 
  19456. function call.  Run-time dynamic linking is typically used for portions of the 
  19457. application code that are rarely required (such as fatal error handling 
  19458. routines); they are therefore explicitly loaded into memory when needed.  In 
  19459. this way, the memory requirements of the application may be reduced. 
  19460.  
  19461.  
  19462. ΓòÉΓòÉΓòÉ 33.176. SAA ΓòÉΓòÉΓòÉ
  19463.  
  19464. SAA 
  19465.  
  19466. See Systems Application Architecture. 
  19467.  
  19468.  
  19469. ΓòÉΓòÉΓòÉ 33.177. scheduler ΓòÉΓòÉΓòÉ
  19470.  
  19471. scheduler 
  19472.  
  19473. Component of OS/2 which provides automated task dispatching. 
  19474.  
  19475.  
  19476. ΓòÉΓòÉΓòÉ 33.178. secondary thread ΓòÉΓòÉΓòÉ
  19477.  
  19478. secondary thread 
  19479.  
  19480. Separate thread of execution created by a Presentation Manager application to 
  19481. handle lengthy processing of a specific type of message using an object window. 
  19482.  
  19483.  
  19484. ΓòÉΓòÉΓòÉ 33.179. segment ΓòÉΓòÉΓòÉ
  19485.  
  19486. segment 
  19487.  
  19488. Unit of memory addressable by the Intel 80x86 processors.  With the 8086 and 
  19489. 80286 processors, a segment may be from 16 bytes to 64 KB in size.  With the 
  19490. 80386 and 80486 processors, a segment may be up to 4 GB in size. 
  19491.  
  19492.  
  19493. ΓòÉΓòÉΓòÉ 33.180. segmented memory model ΓòÉΓòÉΓòÉ
  19494.  
  19495. segmented memory model 
  19496.  
  19497. Mode of addressing used by Intel 80x86 processors, whereby memory is addressed 
  19498. in segments.  Individual units of up to 64 KB (8086/80286) or 4 GB 
  19499. (80386/80486) in size may be allocated by an operating system that uses this 
  19500. memory model. 
  19501.  
  19502.  
  19503. ΓòÉΓòÉΓòÉ 33.181. seg16 ΓòÉΓòÉΓòÉ
  19504.  
  19505. seg16 
  19506.  
  19507. #pragma directive used in C language programming under the IBM C Set/2 
  19508. compiler, which ensures that automatic data structures do not cross a 64 KB 
  19509. segment boundary, and are thus addressable by both 16-bit and 32-bit code. 
  19510. This directive is used when declaring data structures that will be used as 
  19511. parameters when invoking 16-bit functions or subroutines from 32-bit 
  19512. applications. 
  19513.  
  19514.  
  19515. ΓòÉΓòÉΓòÉ 33.182. semaphore ΓòÉΓòÉΓòÉ
  19516.  
  19517. semaphore 
  19518.  
  19519. Data structure provided by OS/2, and used for synchronization between threads 
  19520. and/or processes.  OS/2 Version 2.0 allows mutex semaphores, event semaphores 
  19521. and muxwait semaphores.  Semaphores may also be private (owned and accessible 
  19522. by a single process) or shared (accessible by all processes in the system).  A 
  19523. process may create up to 65,535 private semaphores, and there may be a 
  19524. system-wide total of up to 65,535 shared semaphores in existence at any time. 
  19525.  
  19526.  
  19527. ΓòÉΓòÉΓòÉ 33.183. shared semaphore ΓòÉΓòÉΓòÉ
  19528.  
  19529. shared semaphore 
  19530.  
  19531. See semaphore. 
  19532.  
  19533.  
  19534. ΓòÉΓòÉΓòÉ 33.184. siblings ΓòÉΓòÉΓòÉ
  19535.  
  19536. siblings 
  19537.  
  19538. Term used in the Presentation Manager environment to describe two or more 
  19539. windows that have the same parent window. 
  19540.  
  19541.  
  19542. ΓòÉΓòÉΓòÉ 33.185. simple viewport ΓòÉΓòÉΓòÉ
  19543.  
  19544. simple viewport 
  19545.  
  19546. A viewport within a help window or online document window that is the only 
  19547. viewport within that window.  This is the default case for the display of text 
  19548. or graphics using the Information Presentation Facility.  See also complex 
  19549. viewport. 
  19550.  
  19551.  
  19552. ΓòÉΓòÉΓòÉ 33.186. SNA ΓòÉΓòÉΓòÉ
  19553.  
  19554. SNA 
  19555.  
  19556. System Network Architecture; defined series of layered interfaces and protocols 
  19557. for communication between systems and devices. 
  19558.  
  19559.  
  19560. ΓòÉΓòÉΓòÉ 33.187. SOM ΓòÉΓòÉΓòÉ
  19561.  
  19562. SOM 
  19563.  
  19564. See system object model. 
  19565.  
  19566.  
  19567. ΓòÉΓòÉΓòÉ 33.188. SOM Precompiler ΓòÉΓòÉΓòÉ
  19568.  
  19569. SOM Precompiler 
  19570.  
  19571. Precompiler which generates C source code and header files from a class 
  19572. definition file.  The resulting code may then be edited by a programmer to add 
  19573. application logic, and then compiled using a normal C compiler such as C Set/2. 
  19574.  
  19575.  
  19576. ΓòÉΓòÉΓòÉ 33.189. source ΓòÉΓòÉΓòÉ
  19577.  
  19578. source 
  19579.  
  19580. In a direct manipulation operation, the object or program from which a dragitem 
  19581. is being dragged.  See also direct manipulation, dragitem, target. 
  19582.  
  19583.  
  19584. ΓòÉΓòÉΓòÉ 33.190. sparse object ΓòÉΓòÉΓòÉ
  19585.  
  19586. sparse object 
  19587.  
  19588. Under OS/2 Version 2.0, a memory object that has been allocated but for which 
  19589. no storage has yet been committed.  A sparse object has a valid address range 
  19590. in the process address space, but cannot be the target of a write operation 
  19591. until one or more pages within the object are committed. 
  19592.  
  19593.  
  19594. ΓòÉΓòÉΓòÉ 33.191. SQL ΓòÉΓòÉΓòÉ
  19595.  
  19596. SQL 
  19597.  
  19598. Structured Query Language; Systems Application Architecture-conforming language 
  19599. for the definition and manipulation of data stored in relational database 
  19600. management systems.  SQL is supported in the programmable workstation by OS/2 
  19601. Database Manager, in the AS/400 midrange systems and in System/370 hosts by the 
  19602. DB2 and SQL/DS products. 
  19603.  
  19604.  
  19605. ΓòÉΓòÉΓòÉ 33.192. SRPI ΓòÉΓòÉΓòÉ
  19606.  
  19607. SRPI 
  19608.  
  19609. Server-Requester Programming Interface; programming interface enabling 
  19610. master-slave communication between a workstation application (the requester) 
  19611. and a host application (the server) using an SNA LU2.0 communications link. 
  19612. SRPI is supported in the PWS under DOS, OS/2 Extended Edition V1.x and OS/2 
  19613. Extended Services, and in System/370 hosts running VM/CMS and MVS/TSO. 
  19614.  
  19615.  
  19616. ΓòÉΓòÉΓòÉ 33.193. structured programming ΓòÉΓòÉΓòÉ
  19617.  
  19618. structured programming 
  19619.  
  19620. Application design technique whereby applications are successively broken down 
  19621. into their component functions until a level is achieved at which application 
  19622. code may easily be generated.  See functional decomposition. 
  19623.  
  19624.  
  19625. ΓòÉΓòÉΓòÉ 33.194. subclassing ΓòÉΓòÉΓòÉ
  19626.  
  19627. subclassing 
  19628.  
  19629. Technique whereby messages destined for a particular object are diverted to 
  19630. another object that may perform special processing for a particular message 
  19631. type or provide additional methods not provided by the parent object. 
  19632. Subclassing is typically performed on individual instances of an object class, 
  19633. rather than on the entire class. 
  19634.  
  19635.  
  19636. ΓòÉΓòÉΓòÉ 33.195. synchronous processing ΓòÉΓòÉΓòÉ
  19637.  
  19638. synchronous processing 
  19639.  
  19640. Invocation of another procedure whereby control does not return to the caller 
  19641. until that procedure has completed its processing. 
  19642.  
  19643.  
  19644. ΓòÉΓòÉΓòÉ 33.196. system ΓòÉΓòÉΓòÉ
  19645.  
  19646. system 
  19647.  
  19648. Linkage convention used in C programming under the IBM C Set/2 compiler, which 
  19649. causes the compiler to generate object code for a function or subroutine, such 
  19650. that parameters are placed on the stack in right-to-left order, and the stack 
  19651. is cleared by the calling function when control is returned.   The system 
  19652. linkage convention differs from the default optlink linkage convention in the 
  19653. preservation of register values and the handling of return values. Use of the 
  19654. system linkage convention is required for functions that are invoked by the 
  19655. operating system or Presentation Manager, such as window and dialog procedures. 
  19656. The system linkage convention is specified using the #pragma linkage directive. 
  19657.  
  19658.  
  19659. ΓòÉΓòÉΓòÉ 33.197. system-modal ΓòÉΓòÉΓòÉ
  19660.  
  19661. system-modal 
  19662.  
  19663. Term used to describe a message box or dialog box for which processing must be 
  19664. completed before further interaction with any other window in the system may 
  19665. take place. 
  19666.  
  19667.  
  19668. ΓòÉΓòÉΓòÉ 33.198. system object model ΓòÉΓòÉΓòÉ
  19669.  
  19670. system object model 
  19671.  
  19672. Set of base object classes and object-relationship protocol definitions that 
  19673. defines a basic object-oriented layer on top of Presentation Manager, and which 
  19674. is exploited by the Workplace Shell. 
  19675.  
  19676.  
  19677. ΓòÉΓòÉΓòÉ 33.199. Systems Application Architecture ΓòÉΓòÉΓòÉ
  19678.  
  19679. Systems Application Architecture 
  19680.  
  19681. Set of guidelines for application development, covering areas such as user 
  19682. interfaces, application programming interfaces and communications environments. 
  19683. Systems Application Architecture facilitates ease of use and application 
  19684. portability between environments. 
  19685.  
  19686.  
  19687. ΓòÉΓòÉΓòÉ 33.200. target ΓòÉΓòÉΓòÉ
  19688.  
  19689. target 
  19690.  
  19691. In a direct manipulation operation, the object or program to which a dragitem 
  19692. is being dragged.  See also direct manipulation, dragitem, source. 
  19693.  
  19694.  
  19695. ΓòÉΓòÉΓòÉ 33.201. task state ΓòÉΓòÉΓòÉ
  19696.  
  19697. task state 
  19698.  
  19699. Set of information that embodies the current state of a thread (task) in the 
  19700. system; composed of the register contents and stack belonging to a thread at 
  19701. the time it is pre-empted by the scheduler. 
  19702.  
  19703.  
  19704. ΓòÉΓòÉΓòÉ 33.202. thread ΓòÉΓòÉΓòÉ
  19705.  
  19706. thread 
  19707.  
  19708. Atomic unit of dispatch under OS/2.  One or more threads make up a process; the 
  19709. threads within a process may share resources belonging to that process. 
  19710.  
  19711.  
  19712. ΓòÉΓòÉΓòÉ 33.203. thunking ΓòÉΓòÉΓòÉ
  19713.  
  19714. thunking 
  19715.  
  19716. Term used to describe the process of address conversion, stack and structure 
  19717. realignment, etc., necessary when passing control between 16-bit and 32-bit 
  19718. modules under OS/2 Version 2.0. 
  19719.  
  19720.  
  19721. ΓòÉΓòÉΓòÉ 33.204. thunk procedure ΓòÉΓòÉΓòÉ
  19722.  
  19723. thunk procedure 
  19724.  
  19725. Application procedure that performs thunking. 
  19726.  
  19727.  
  19728. ΓòÉΓòÉΓòÉ 33.205. timer ΓòÉΓòÉΓòÉ
  19729.  
  19730. timer 
  19731.  
  19732. Facility provided under OS/2 Presentation Manager, whereby Presentation Manager 
  19733. will dispatch a message of class WM_TIMER to a particular window at specified 
  19734. intervals.  This capability may be used by an application to perform a specific 
  19735. processing task at predetermined intervals, without the necessity for the 
  19736. application to explicitly keep track of the passage of time. 
  19737.  
  19738.  
  19739. ΓòÉΓòÉΓòÉ 33.206. title bar ΓòÉΓòÉΓòÉ
  19740.  
  19741. title bar 
  19742.  
  19743. Area at the top of a CUA-conforming window that contains the title of the 
  19744. window (typically identifying the data object or device to which the window 
  19745. relates). 
  19746.  
  19747.  
  19748. ΓòÉΓòÉΓòÉ 33.207. transient object ΓòÉΓòÉΓòÉ
  19749.  
  19750. transient object 
  19751.  
  19752. A Workplace Shell object that does not persist beyond a system IPL.  Transient 
  19753. object classes are descendants of the WPTransient object class. 
  19754.  
  19755.  
  19756. ΓòÉΓòÉΓòÉ 33.208. TSR ΓòÉΓòÉΓòÉ
  19757.  
  19758. TSR 
  19759.  
  19760. Terminate-and-Stay-Resident; term used to describe a DOS application that 
  19761. modifies an operating system interrupt vector to point to its own location 
  19762. (known as hooking an interrupt).  This process is not permitted under OS/2, 
  19763. although facilities exist under OS/2 to provide the same capability for 
  19764. applications. 
  19765.  
  19766.  
  19767. ΓòÉΓòÉΓòÉ 33.209. user-level ΓòÉΓòÉΓòÉ
  19768.  
  19769. user-level 
  19770.  
  19771. Term used to describe an application resource that is currently undergoing 
  19772. modification and unit testing;  when unit testing is complete, the resource is 
  19773. then submitted for baselining and subsequent promotion to production level. 
  19774.  
  19775.  
  19776. ΓòÉΓòÉΓòÉ 33.210. view ΓòÉΓòÉΓòÉ
  19777.  
  19778. view 
  19779.  
  19780. In the Workplace Shell, a view is a window that displays the contents or 
  19781. properties of an object is a particular manner.  For example, an "icon view" 
  19782. displays the contents of a container object as a series of icons. The same 
  19783. object may also have a "settings view", which displays the characteristics of 
  19784. the object. 
  19785.  
  19786.  
  19787. ΓòÉΓòÉΓòÉ 33.211. viewport ΓòÉΓòÉΓòÉ
  19788.  
  19789. viewport 
  19790.  
  19791. Under the Information Presentation Facility, a portion of a help window or 
  19792. online document window that may be separately manipulated.  The use of multiple 
  19793. viewports in a window enables the display of different types of information in 
  19794. the same window, with separate formatting and scrolling.  Viewports may be 
  19795. either simple or complex, and may be IPF-controlled or application-controlled. 
  19796.  
  19797.  
  19798. ΓòÉΓòÉΓòÉ 33.212. VIO ΓòÉΓòÉΓòÉ
  19799.  
  19800. VIO 
  19801.  
  19802. Term used to describe the OS/2 Video Subsystem, used by text-windowed and 
  19803. full-screen protect-mode applications executing under OS/2. 
  19804.  
  19805.  
  19806. ΓòÉΓòÉΓòÉ 33.213. window ΓòÉΓòÉΓòÉ
  19807.  
  19808. window 
  19809.  
  19810. A conceptual identity under OS/2 presentation manager;  a window is essentially 
  19811. a handle associated with a data object such as a presentation space on the 
  19812. screen or a database that, along with an associated window procedure, comprises 
  19813. an application object.  Hence a window may be considered as equivalent to an 
  19814. application object. 
  19815.  
  19816.  
  19817. ΓòÉΓòÉΓòÉ 33.214. window class ΓòÉΓòÉΓòÉ
  19818.  
  19819. window class 
  19820.  
  19821. A group of windows having a common set of data object definitions and 
  19822. processing requirements, and which therefore share a common window procedure. 
  19823. In object-oriented terms, a window class equates to an object class. 
  19824.  
  19825.  
  19826. ΓòÉΓòÉΓòÉ 33.215. window handle ΓòÉΓòÉΓòÉ
  19827.  
  19828. window handle 
  19829.  
  19830. Unique identifier of a window, generated by Presentation Manager when the 
  19831. window is created, and used by applications to direct messages to the window. 
  19832.  
  19833.  
  19834. ΓòÉΓòÉΓòÉ 33.216. window procedure ΓòÉΓòÉΓòÉ
  19835.  
  19836. window procedure 
  19837.  
  19838. A procedure in an OS/2 Presentation Manager application that processes messages 
  19839. intended for a particular window class.  In object-oriented terms, a window 
  19840. procedure contains the data object definitions and methods associated with a 
  19841. particular application object. 
  19842.  
  19843.  
  19844. ΓòÉΓòÉΓòÉ 33.217. window words ΓòÉΓòÉΓòÉ
  19845.  
  19846. window words 
  19847.  
  19848. Storage area within the control block maintained for each window by 
  19849. Presentation Manager that is available for an application to store information 
  19850. such as a pointer to a memory object containing instance data. 
  19851.  
  19852.  
  19853. ΓòÉΓòÉΓòÉ 33.218. winproc ΓòÉΓòÉΓòÉ
  19854.  
  19855. winproc 
  19856.  
  19857. See window procedure. 
  19858.  
  19859.  
  19860. ΓòÉΓòÉΓòÉ 33.219. Workplace Environment ΓòÉΓòÉΓòÉ
  19861.  
  19862. Workplace Environment 
  19863.  
  19864. User interface model defined in the 1991 IBM Systems Application Architecture 
  19865. CUA Advanced Guide to User Interface Design, whereby direct manipulation of 
  19866. icons is used to provide a conceptual analogy of the user's physical working 
  19867. environment. 
  19868.  
  19869.  
  19870. ΓòÉΓòÉΓòÉ 33.220. Workplace Shell ΓòÉΓòÉΓòÉ
  19871.  
  19872. Workplace Shell 
  19873.  
  19874. Standard user interface component of OS/2 Version 2.0 that provides an 
  19875. object-oriented interface for the end user.  The implementation of the 
  19876. Workplace Shell is based upon the system object model. 
  19877.  
  19878.  
  19879. ΓòÉΓòÉΓòÉ 33.221. Workplace Shell object ΓòÉΓòÉΓòÉ
  19880.  
  19881. Workplace Shell object 
  19882.  
  19883. An object created by the Workplace Shell, typically at the request of the user 
  19884. or an application.  A Workplace Shell object is very similar in concept to an 
  19885. application object, in that it possesses data and methods that operate upon 
  19886. that data.  See also application object. 
  19887.  
  19888.  
  19889. ΓòÉΓòÉΓòÉ 33.222. z-order ΓòÉΓòÉΓòÉ
  19890.  
  19891. z-order 
  19892.  
  19893. Conceptual order of windows on the desktop; windows are considered to be 
  19894. located "one on top of another". 
  19895.  
  19896.  
  19897. ΓòÉΓòÉΓòÉ 33.223. 0:32 ΓòÉΓòÉΓòÉ
  19898.  
  19899. 0:32 
  19900.  
  19901. Term used to describe the addressing scheme used for the 32-bit flat memory 
  19902. model, where a memory address is expressed as a 32-bit linear offset within the 
  19903. linear address range. 
  19904.  
  19905.  
  19906. ΓòÉΓòÉΓòÉ 33.224. 16:16 ΓòÉΓòÉΓòÉ
  19907.  
  19908. 16:16 
  19909.  
  19910. Term used to describe the addressing scheme used for the 16-bit segmented 
  19911. memory model, where a memory address is expressed as a 16-bit segment selector, 
  19912. and a 16-bit offset within that segment. 
  19913.  
  19914.  
  19915. ΓòÉΓòÉΓòÉ 33.225. 80286 ΓòÉΓòÉΓòÉ
  19916.  
  19917. 80286 
  19918.  
  19919. Intel 80286 microprocessor, 16-bit microprocessor that provides both real and 
  19920. virtual memory support, and allows multitasking and automated task dispatching. 
  19921. Successor to the Intel 8086/8088 family. 
  19922.  
  19923.  
  19924. ΓòÉΓòÉΓòÉ 33.226. 80386 ΓòÉΓòÉΓòÉ
  19925.  
  19926. 80386 
  19927.  
  19928. Intel 80386 microprocessor; the 32-bit processor upon which the OS/2 Version 
  19929. 2.0 operating system is based. 
  19930.  
  19931.  
  19932. ΓòÉΓòÉΓòÉ 33.227. 80486 ΓòÉΓòÉΓòÉ
  19933.  
  19934. 80486 
  19935.  
  19936. Intel 80486 microprocessor; a 32-bit processor that implements a superset of 
  19937. the 80386 processor instruction set. 
  19938.  
  19939.  
  19940. ΓòÉΓòÉΓòÉ 33.228. 8086/8088 ΓòÉΓòÉΓòÉ
  19941.  
  19942. 8086/8088 
  19943.  
  19944. Microprocessor family developed by Intel Corporation for use in personal 
  19945. computers.  The 8086/8088 family provides 8-bit real memory addressing mode 
  19946. only, and is limited to an address space of 1 MB. 
  19947.  
  19948.  
  19949. ΓòÉΓòÉΓòÉ 33.229. _far16 ΓòÉΓòÉΓòÉ
  19950.  
  19951. _far16 
  19952.  
  19953. Linkage convention used in C programming language within the #pragma linkage 
  19954. directive under the IBM C Set/2 compiler, to indicate that a function or 
  19955. subroutine resides in a 16-bit module, and that thunking is required when the 
  19956. function or subroutine is invoked. 
  19957.  
  19958.  
  19959. ΓòÉΓòÉΓòÉ 33.230. _Seg16 ΓòÉΓòÉΓòÉ
  19960.  
  19961. _Seg16 
  19962.  
  19963. Keyword used in C programming language under the IBM C Set/2  compiler, to 
  19964. indicate that a pointer should be stored in 16:16 format rather than 0:32 
  19965. format.  See also seg16. 
  19966.  
  19967.  
  19968. ΓòÉΓòÉΓòÉ 33.231. #pragma linkage ΓòÉΓòÉΓòÉ
  19969.  
  19970. #pragma linkage 
  19971.  
  19972. Directive used with the IBM C Set/2 compiler to determine the linkage 
  19973. convention for a function or function type declaration.  See also optlink and 
  19974. system. 
  19975.  
  19976.  
  19977. ΓòÉΓòÉΓòÉ 33.232. #pragma seg16 ΓòÉΓòÉΓòÉ
  19978.  
  19979. #pragma seg16 
  19980.  
  19981. Directive used with the IBM C Set/2 compiler to ensure that a data structure is 
  19982. aligned on a 64 KB segment boundary, and is thus addressable by 16-bit 
  19983. application code.  See also seg16. 
  19984.  
  19985.  
  19986. ΓòÉΓòÉΓòÉ 33.233. #pragma stack16 ΓòÉΓòÉΓòÉ
  19987.  
  19988. #pragma stack16 
  19989.  
  19990. Directive used with the IBM C Set/2 compiler to set the stack size for all 
  19991. 16-bit function calls made from a 32-bit application module. 
  19992.  
  19993.  
  19994. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  19995.  
  19996. Note that a dialog box is known as an action window under CUA'91.  However, the 
  19997. term dialog box is used in most Presentation Manager documentation, and will be 
  19998. used throughout this document for